From: Christos Zoulas Date: Wed, 16 May 2007 20:51:40 +0000 (+0000) Subject: Coverity CID 4418: don't call strlen() with NULL X-Git-Tag: FILE5_05~611 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f11e61d459d3b97eb2354ff639847aec25cea50a;p=file Coverity CID 4418: don't call strlen() with NULL --- diff --git a/src/apprentice.c b/src/apprentice.c index 2c34970d..d5a5bec5 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -46,7 +46,7 @@ #endif #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.104 2007/01/19 19:54:39 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.105 2007/05/16 20:51:40 christos Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ @@ -327,10 +327,11 @@ file_apprentice(struct magic_set *ms, const char *fn, int action) if (fn == NULL) fn = MAGIC; - if ((fn = mfn = strdup(fn)) == NULL) { + if ((mfn = strdup(fn)) == NULL) { file_oomem(ms, strlen(fn)); return NULL; } + fn = mfn; if ((mlist = malloc(sizeof(*mlist))) == NULL) { free(mfn);