[PATCH] parse_object: check if buffer is non-NULL before freeing it
- From
Jonas Fonseca <fonseca@diku.dk>
- Date
- Aug 28, 2006, 00:31 UTC
- Message-ID
- <20060828003129.GE20904@diku.dk>
Two code paths may cause this and other places in the source have the courtesy to do the check.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> --- object.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/object.c b/object.c index 9281300..c08347f 100644 --- a/object.c +++ b/object.c @@ -173,7 +173,8 @@ struct object *parse_object(const unsign } else { obj = NULL; } - free(buffer); + if (buffer) + free(buffer); return obj; } return NULL;
-- 1.4.2.g2f76-dirty -- Jonas Fonseca