-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
#include "file.h" | ||
|
||
#ifndef lint | ||
FILE_RCSID("@(#)$File: softmagic.c,v 1.175 2014/02/18 11:09:31 kim Exp $") | ||
FILE_RCSID("@(#)$File: softmagic.c,v 1.176 2014/02/18 17:59:21 kim Exp $") | ||
#endif /* lint */ | ||
|
||
#include "magic.h" | ||
|
@@ -1762,12 +1762,16 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, | |
ms->offset = soffset; | ||
if (rv == 1) { | ||
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && | ||
file_printf(ms, F(m->desc, "%u"), offset) == -1) | ||
file_printf(ms, F(m->desc, "%u"), offset) == -1) { | ||
free(rbuf); | ||
return -1; | ||
if (file_printf(ms, "%s", rbuf) == -1) | ||
} | ||
if (file_printf(ms, "%s", rbuf) == -1) { | ||
free(rbuf); | ||
return -1; | ||
free(rbuf); | ||
} | ||
} | ||
free(rbuf); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
glensc
Member
|
||
return rv; | ||
|
||
case FILE_USE: | ||
|
I observe, in some run condition, than rbuf could be NULL, so this could raise a minor issue.
The path applied in PHP seems to work correctly with
Ok, free(NULL) is valid.
Would it be simpler to use: