]> granicus.if.org Git - neomutt/commitdiff
Fixing a number of traditional malloc calls which have made their
authorThomas Roessler <roessler@does-not-exist.org>
Fri, 6 Dec 2002 10:56:30 +0000 (10:56 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Fri, 6 Dec 2002 10:56:30 +0000 (10:56 +0000)
way into the code.

curs_lib.c
pgppubring.c

index ae4f17e4ba5289f95727f8f84ca7909bbcc411dd..e31acc73f21ea9d618c6537fdcaf8e7b8e09abc6 100644 (file)
@@ -181,7 +181,7 @@ int mutt_yesorno (const char *msg, int def)
    * ensure there is enough room for the answer and truncate the question
    * to fit.
    */
-  answer_string = malloc (COLS + 1);
+  answer_string = safe_malloc (COLS + 1);
   snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def ? yes : no, def ? no : yes);
   answer_string_len = strlen (answer_string);
   printw ("%.*s%s", COLS - answer_string_len, msg, answer_string);
index 7dd3a4455650ddd8d92f5780cc4d59a6f8b9e9d6..9c03603dcdb9bfdf115e7b84905761fae355862d 100644 (file)
@@ -763,10 +763,10 @@ static void pgpring_find_candidates (char *ringfile, const char *hints[], int nh
     size_t error_buf_len;
 
     error_buf_len = sizeof ("fopen: ") - 1 + strlen (ringfile) + 1;
-    error_buf = malloc (error_buf_len);
+    error_buf = safe_malloc (error_buf_len);
     snprintf (error_buf, error_buf_len, "fopen: %s", ringfile);
     perror (error_buf);
-    free (error_buf);
+    safe_free (&error_buf);
     return;
   }