summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--helper/ext2initrd.c4
-rw-r--r--helper/utils.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/helper/ext2initrd.c b/helper/ext2initrd.c
index dedc1e8..8b64e0f 100644
--- a/helper/ext2initrd.c
+++ b/helper/ext2initrd.c
@@ -1,5 +1,5 @@
/* febootstrap-supermin-helper reimplementation in C.
- * Copyright (C) 2009-2011 Red Hat Inc.
+ * Copyright (C) 2009-2012 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -115,6 +115,7 @@ ext2_make_initrd (const char *modpath, const char *initrd)
FILE *f = fopen (outfile, "w");
if (f == NULL)
error (EXIT_FAILURE, errno, "failed to create modules list (%s)", outfile);
+ free (outfile);
FILE *pp = popen (cmd, "w");
if (pp == NULL)
error (EXIT_FAILURE, errno, "failed to create pipe (%s)", cmd);
@@ -175,6 +176,7 @@ read_module_deps (const char *modpath)
char *filename = xasprintf ("%s/modules.dep", modpath);
FILE *fp = fopen (filename, "r");
+ free (filename);
if (fp == NULL)
error (EXIT_FAILURE, errno, "open: %s/modules.dep", modpath);
diff --git a/helper/utils.c b/helper/utils.c
index 81b300a..3308c3c 100644
--- a/helper/utils.c
+++ b/helper/utils.c
@@ -1,5 +1,5 @@
/* febootstrap-supermin-helper reimplementation in C.
- * Copyright (C) 2009-2010 Red Hat Inc.
+ * Copyright (C) 2009-2010, 2012 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -306,6 +306,7 @@ load_file (const char *filename)
line[len-1] = '\0';
add_string (&lines, &n_used, &n_alloc, line);
}
+ fclose (fp);
add_string (&lines, &n_used, &n_alloc, NULL);
return lines;