From: Christos Zoulas Date: Mon, 13 Jun 2016 12:02:06 +0000 (+0000) Subject: fix memory leak on error (delphij) X-Git-Tag: FILE5_28~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85b84a8bee16d896d6b12a5e21cf7dbc20ff26fc;p=file fix memory leak on error (delphij) --- diff --git a/src/softmagic.c b/src/softmagic.c index 1ccfa571..4d52fe61 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.232 2016/06/01 22:01:15 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.233 2016/06/01 22:04:10 christos Exp $") #endif /* lint */ #include "magic.h" @@ -2080,6 +2080,7 @@ magiccheck(struct magic_set *ms, struct magic *m) if (slen != 0) { copy = malloc(slen); if (copy == NULL) { + file_regfree(&rx); file_error(ms, errno, "can't allocate %" SIZE_T_FORMAT "u bytes", slen);