summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-08-16 05:32:42 +0000
committerMike Frysinger <vapier@gentoo.org>2005-08-16 05:32:42 +0000
commit1eef0c4571d6319e67005944b7c20307fb8f5b15 (patch)
tree47b604f693a34a36895b4cfd4cfb47ccf6e3c029 /archival
parent71224980e1a26977c0884c679a51c685ad46a44f (diff)
downloadbusybox-w32-1eef0c4571d6319e67005944b7c20307fb8f5b15.tar.gz
busybox-w32-1eef0c4571d6319e67005944b7c20307fb8f5b15.tar.bz2
busybox-w32-1eef0c4571d6319e67005944b7c20307fb8f5b15.zip
Bernhard Fischer says: use xmalloc() instead of malloc()
Diffstat (limited to 'archival')
-rw-r--r--archival/dpkg.c2
-rw-r--r--archival/libunarchive/decompress_unzip.c2
-rw-r--r--archival/rpm.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 89446574e..5f9f3a76b 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1299,7 +1299,7 @@ static char **all_control_list(const char *package_name)
1299 char **remove_files; 1299 char **remove_files;
1300 1300
1301 /* Create a list of all /var/lib/dpkg/info/<package> files */ 1301 /* Create a list of all /var/lib/dpkg/info/<package> files */
1302 remove_files = malloc(sizeof(all_control_files)); 1302 remove_files = xmalloc(sizeof(all_control_files));
1303 while (all_control_files[i]) { 1303 while (all_control_files[i]) {
1304 remove_files[i] = xmalloc(strlen(package_name) + strlen(all_control_files[i]) + 21); 1304 remove_files[i] = xmalloc(strlen(package_name) + strlen(all_control_files[i]) + 21);
1305 sprintf(remove_files[i], "/var/lib/dpkg/info/%s.%s", package_name, all_control_files[i]); 1305 sprintf(remove_files[i], "/var/lib/dpkg/info/%s.%s", package_name, all_control_files[i]);
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index 883aaac46..3d0364339 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -176,7 +176,7 @@ static void make_gunzip_crc_table(void)
176 176
177 /* initial shift register value */ 177 /* initial shift register value */
178 gunzip_crc = 0xffffffffL; 178 gunzip_crc = 0xffffffffL;
179 gunzip_crc_table = (unsigned int *) malloc(256 * sizeof(unsigned int)); 179 gunzip_crc_table = (unsigned int *) xmalloc(256 * sizeof(unsigned int));
180 180
181 /* Compute and print table of CRC's, five per line */ 181 /* Compute and print table of CRC's, five per line */
182 for (i = 0; i < 256; i++) { 182 for (i = 0; i < 256; i++) {
diff --git a/archival/rpm.c b/archival/rpm.c
index 41c6129ad..fa8db539a 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -243,7 +243,7 @@ rpm_index **rpm_gettags(int fd, int *num_tags)
243 storepos = lseek(fd,0,SEEK_CUR) + header.entries * 16; 243 storepos = lseek(fd,0,SEEK_CUR) + header.entries * 16;
244 244
245 while (header.entries--) { 245 while (header.entries--) {
246 tmpindex = tags[tagindex++] = malloc(sizeof(rpm_index)); 246 tmpindex = tags[tagindex++] = xmalloc(sizeof(rpm_index));
247 read(fd, tmpindex, sizeof(rpm_index)); 247 read(fd, tmpindex, sizeof(rpm_index));
248 tmpindex->tag = ntohl(tmpindex->tag); tmpindex->type = ntohl(tmpindex->type); tmpindex->count = ntohl(tmpindex->count); 248 tmpindex->tag = ntohl(tmpindex->tag); tmpindex->type = ntohl(tmpindex->type); tmpindex->count = ntohl(tmpindex->count);
249 tmpindex->offset = storepos + ntohl(tmpindex->offset); 249 tmpindex->offset = storepos + ntohl(tmpindex->offset);