[PATCH] Fix memory leak in apply_filter.
- From
Pierre Habouzit <madcoder@debian.org>
- Date
- Oct 5, 2007, 08:29 UTC
- Message-ID
- <20071005082925.GG19879@artemis.corp>
- In-Reply-To
- <20071005082026.GE19879@artemis.corp>
Signed-off-by: Pierre Habouzit <madcoder@debian.org> ---
While we're at it... Here is a stupid memory leak in apply_filter. On top of the previous commit.
The same, repost, unsigned doh.
convert.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/convert.c b/convert.c index 4664197..d5c197f 100644 --- a/convert.c +++ b/convert.c @@ -293,10 +293,9 @@ static int apply_filter(const char *path, const char *src, size_t len, } if (ret) { - *dst = nbuf; - } else { - strbuf_release(&nbuf); + strbuf_swap(dst, &nbuf); } + strbuf_release(&nbuf); return ret; }
-- 1.5.3.4.208.gdcc67-dirty