lkml.org 
[lkml]   [2005]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] gen_init_cpio.c : don't check for NULL before free()

in usr/gen_init_cpio.c::cpio_mkfile() a pointer is checked for NULL before
calling free() on it - this is redundant, free() copes just fine with NULL
pointers.


Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

--- linux-2.6.11-mm4-orig/usr/gen_init_cpio.c 2005-03-02 08:38:12.000000000 +0100
+++ linux-2.6.11-mm4/usr/gen_init_cpio.c 2005-03-17 01:05:25.000000000 +0100
@@ -349,7 +349,7 @@ static int cpio_mkfile(const char *name,
rc = 0;

error:
- if (filebuf) free(filebuf);
+ free(filebuf);
if (file >= 0) close(file);
return rc;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.436 / U:1.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site