Commit faa576f4 faa576f4617e4191f5eaa20451e619bfa616b9a0 by Sergey Poznyakoff

Free return value of mu_get_homedir().

1 parent 976c5aba
...@@ -78,6 +78,7 @@ mh_init () ...@@ -78,6 +78,7 @@ mh_init ()
78 mh_error ("low memory"); 78 mh_error ("low memory");
79 exit (1); 79 exit (1);
80 } 80 }
81 free (p);
81 } 82 }
82 else if (strchr (current_folder, ':') == NULL) 83 else if (strchr (current_folder, ':') == NULL)
83 { 84 {
...@@ -122,6 +123,7 @@ mh_read_profile () ...@@ -122,6 +123,7 @@ mh_read_profile ()
122 if (!home) 123 if (!home)
123 abort (); /* shouldn't happen */ 124 abort (); /* shouldn't happen */
124 asprintf (&p, "%s/%s", home, MH_USER_PROFILE); 125 asprintf (&p, "%s/%s", home, MH_USER_PROFILE);
126 free (home);
125 } 127 }
126 mh_read_context_file (p, &profile_header); 128 mh_read_context_file (p, &profile_header);
127 } 129 }
...@@ -377,7 +379,10 @@ mh_audit_open (char *name, mailbox_t mbox) ...@@ -377,7 +379,10 @@ mh_audit_open (char *name, mailbox_t mbox)
377 if (strchr (namep, '/') == NULL) 379 if (strchr (namep, '/') == NULL)
378 { 380 {
379 char *p = NULL; 381 char *p = NULL;
380 asprintf (&p, "%s/Mail/%s", mu_get_homedir (), namep); 382 char *home;
383
384 asprintf (&p, "%s/Mail/%s", home = mu_get_homedir (), namep);
385 free (home);
381 if (!p) 386 if (!p)
382 { 387 {
383 mh_error ("low memory"); 388 mh_error ("low memory");
......