summaryrefslogtreecommitdiffstats
path: root/funcs.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-05-18 22:27:42 +0000
committerdelphij <delphij@FreeBSD.org>2009-05-18 22:27:42 +0000
commit862d9405b857dba35f8f2eb6d0623b9a552d4353 (patch)
treec176aed40df9d569e6997b325eceec4cbf609fb7 /funcs.c
parent00d8dd21dbcbead074383f1483d0ade146f266d9 (diff)
downloadFreeBSD-src-862d9405b857dba35f8f2eb6d0623b9a552d4353.zip
FreeBSD-src-862d9405b857dba35f8f2eb6d0623b9a552d4353.tar.gz
Virgin import of Christos Zoulas's FILE 5.03.
Security: CVE-2009-1515
Diffstat (limited to 'funcs.c')
-rw-r--r--funcs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/funcs.c b/funcs.c
index af10688..c6f0d09 100644
--- a/funcs.c
+++ b/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.53 2009/04/07 11:07:00 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -303,7 +303,14 @@ file_reset(struct magic_set *ms)
file_error(ms, 0, "no magic files loaded");
return -1;
}
- ms->o.buf = NULL;
+ if (ms->o.buf) {
+ 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;
OpenPOWER on IntegriCloud