fix a few mallocs to be xmallocs.
-Erik
This commit is contained in:
parent
02b9f42a27
commit
b50d707633
@ -192,7 +192,7 @@ static void depends_sort_visit(package_t **ordered, package_t *pkgs,
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* add it to the list */
|
/* 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 */
|
/* make a shallow copy */
|
||||||
*newnode = *pkg;
|
*newnode = *pkg;
|
||||||
newnode->next = *ordered;
|
newnode->next = *ordered;
|
||||||
@ -609,7 +609,7 @@ static int dpkg_dounpack(package_t *pkg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create the list file */
|
/* 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);
|
strcpy(lst_file, infodir);
|
||||||
strcat(lst_file, pkg->package);
|
strcat(lst_file, pkg->package);
|
||||||
strcat(lst_file, ".list");
|
strcat(lst_file, ".list");
|
||||||
|
4
dpkg.c
4
dpkg.c
@ -192,7 +192,7 @@ static void depends_sort_visit(package_t **ordered, package_t *pkgs,
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* add it to the list */
|
/* 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 */
|
/* make a shallow copy */
|
||||||
*newnode = *pkg;
|
*newnode = *pkg;
|
||||||
newnode->next = *ordered;
|
newnode->next = *ordered;
|
||||||
@ -609,7 +609,7 @@ static int dpkg_dounpack(package_t *pkg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create the list file */
|
/* 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);
|
strcpy(lst_file, infodir);
|
||||||
strcat(lst_file, pkg->package);
|
strcat(lst_file, pkg->package);
|
||||||
strcat(lst_file, ".list");
|
strcat(lst_file, ".list");
|
||||||
|
Loading…
Reference in New Issue
Block a user