diff src/readpst.c @ 289:cc8ee701f190

pst_block_offset elements are unsigned; consistent usage of pst_malloc and pst_realloc
author Carl Byington <carl@five-ten-sg.com>
date Fri, 27 May 2011 11:36:49 -0700
parents fa7fc1ac6385
children fec37c150982
line wrap: on
line diff
--- a/src/readpst.c	Fri May 27 09:50:24 2011 -0700
+++ b/src/readpst.c	Fri May 27 11:36:49 2011 -0700
@@ -742,7 +742,7 @@
         x = errno;
         DIE(("mk_kmail_dir: Cannot change to directory %s: %s\n", kmail_chdir, strerror(x)));
     }
-    dir = malloc(strlen(fname)+strlen(OUTPUT_KMAIL_DIR_TEMPLATE)+1);
+    dir = pst_malloc(strlen(fname)+strlen(OUTPUT_KMAIL_DIR_TEMPLATE)+1);
     sprintf(dir, OUTPUT_KMAIL_DIR_TEMPLATE, fname);
     check_filename(dir);
     if (D_MKDIR(dir)) {
@@ -751,17 +751,17 @@
             DIE(("mk_kmail_dir: Cannot create directory %s: %s\n", dir, strerror(x)));
         }
     }
-    kmail_chdir = realloc(kmail_chdir, strlen(dir)+1);
+    kmail_chdir = pst_realloc(kmail_chdir, strlen(dir)+1);
     strcpy(kmail_chdir, dir);
     free (dir);
 
     //we should remove any existing indexes created by KMail, cause they might be different now
-    index = malloc(strlen(fname)+strlen(KMAIL_INDEX)+1);
+    index = pst_malloc(strlen(fname)+strlen(KMAIL_INDEX)+1);
     sprintf(index, KMAIL_INDEX, fname);
     unlink(index);
     free(index);
 
-    out_name = malloc(strlen(fname)+strlen(OUTPUT_TEMPLATE)+1);
+    out_name = pst_malloc(strlen(fname)+strlen(OUTPUT_TEMPLATE)+1);
     sprintf(out_name, OUTPUT_TEMPLATE, fname);
     DEBUG_RET();
     return out_name;