From: Christos Zoulas Date: Tue, 7 Apr 2009 11:07:00 +0000 (+0000) Subject: make sure we free everything. X-Git-Tag: FILE5_01~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=330cd2b62cd8312ddb2a679f659f598ff6912dff;p=file make sure we free everything. --- diff --git a/src/funcs.c b/src/funcs.c index 167ce851..1fb74228 100644 --- a/src/funcs.c +++ b/src/funcs.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.51 2008/11/07 18:57:28 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.52 2009/02/13 18:24:18 christos Exp $") #endif /* lint */ #include "magic.h" @@ -307,6 +307,10 @@ file_reset(struct magic_set *ms) free(ms->o.buf); ms->o.buf = NULL; } + if (ms->o.pbuf) { + free(ms->o.pbuf); + ms->o.pbuf = NULL; + } ms->event_flags &= ~EVENT_HAD_ERR; ms->error = -1; return 0;