Fixed a memory leak in lash. It seems that close_all was calling close()
[oweals/busybox.git] / dpkg.c
diff --git a/dpkg.c b/dpkg.c
index 4a5c6f4da7f16eb56931bcfab1a9660884efa835..0e4fd8efcfb747c546d80a58dee03a02335cb2be 100644 (file)
--- a/dpkg.c
+++ b/dpkg.c
@@ -192,7 +192,7 @@ static void depends_sort_visit(package_t **ordered, package_t *pkgs,
 
 #if 0
        /* add it to the list */
-       newnode = (struct package_t *)malloc(sizeof(struct package_t));
+       newnode = (struct package_t *)xmalloc(sizeof(struct package_t));
        /* make a shallow copy */
        *newnode = *pkg;
        newnode->next = *ordered;
@@ -609,7 +609,7 @@ static int dpkg_dounpack(package_t *pkg)
                }
 
                /* create the list file */
-               lst_file = (char *) malloc(strlen(infodir) + strlen(pkg->package) + 6);
+               lst_file = (char *) xmalloc(strlen(infodir) + strlen(pkg->package) + 6);
                strcpy(lst_file, infodir);
                strcat(lst_file, pkg->package);
                strcat(lst_file, ".list");
@@ -840,7 +840,7 @@ extern int dpkg_main(int argc, char **argv)
                case 'c':
                        return dpkg_configure(packages, status);
                default :
-                       usage(dpkg_usage);
+                       show_usage();
                        return EXIT_FAILURE;
        }
-}
\ No newline at end of file
+}