Bernhard Fischer says: use xmalloc() instead of malloc()
authorMike Frysinger <vapier@gentoo.org>
Tue, 16 Aug 2005 05:32:42 +0000 (05:32 -0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 16 Aug 2005 05:32:42 +0000 (05:32 -0000)
archival/dpkg.c
archival/libunarchive/decompress_unzip.c
archival/rpm.c

index 89446574e6691722e971ab33bf09e89db2c950e0..5f9f3a76bfc12d65ad56d5ddbeb722d79dd16943 100644 (file)
@@ -1299,7 +1299,7 @@ static char **all_control_list(const char *package_name)
        char **remove_files;
 
        /* Create a list of all /var/lib/dpkg/info/<package> files */
-       remove_files = malloc(sizeof(all_control_files));
+       remove_files = xmalloc(sizeof(all_control_files));
        while (all_control_files[i]) {
                remove_files[i] = xmalloc(strlen(package_name) + strlen(all_control_files[i]) + 21);
                sprintf(remove_files[i], "/var/lib/dpkg/info/%s.%s", package_name, all_control_files[i]);
index 883aaac460a2518aa1a137907056891ba5efdee8..3d03643395d7e2cea5a35eeffe6f299e8d5a4699 100644 (file)
@@ -176,7 +176,7 @@ static void make_gunzip_crc_table(void)
 
        /* initial shift register value */
        gunzip_crc = 0xffffffffL;
-       gunzip_crc_table = (unsigned int *) malloc(256 * sizeof(unsigned int));
+       gunzip_crc_table = (unsigned int *) xmalloc(256 * sizeof(unsigned int));
 
        /* Compute and print table of CRC's, five per line */
        for (i = 0; i < 256; i++) {
index 41c6129adb2e65a70d39f50e264350a6e5829db3..fa8db539a33a44438cbe21111483050dd19ec52d 100644 (file)
@@ -243,7 +243,7 @@ rpm_index **rpm_gettags(int fd, int *num_tags)
                storepos = lseek(fd,0,SEEK_CUR) + header.entries * 16;
 
                while (header.entries--) {
-                       tmpindex = tags[tagindex++] = malloc(sizeof(rpm_index));
+                       tmpindex = tags[tagindex++] = xmalloc(sizeof(rpm_index));
                        read(fd, tmpindex, sizeof(rpm_index));
                        tmpindex->tag = ntohl(tmpindex->tag); tmpindex->type = ntohl(tmpindex->type); tmpindex->count = ntohl(tmpindex->count);
                        tmpindex->offset = storepos + ntohl(tmpindex->offset);