mbx_unix.c
mailbox_unix_expunge: forget to free tmpmbox filename.
Showing
1 changed file
with
6 additions
and
0 deletions
... | @@ -999,7 +999,11 @@ mailbox_unix_tmpfile (mailbox_t mbox, char *tmpmbox) | ... | @@ -999,7 +999,11 @@ mailbox_unix_tmpfile (mailbox_t mbox, char *tmpmbox) |
999 | } | 999 | } |
1000 | fp = fdopen(fd, "w+"); | 1000 | fp = fdopen(fd, "w+"); |
1001 | if (fp == 0) | 1001 | if (fp == 0) |
1002 | { | ||
1002 | close(fd); | 1003 | close(fd); |
1004 | free (tmpmbox); | ||
1005 | tmpmbox = NULL; | ||
1006 | } | ||
1003 | 1007 | ||
1004 | /* really I should just remove the file here */ | 1008 | /* really I should just remove the file here */ |
1005 | /* remove(tmpmbox); */ | 1009 | /* remove(tmpmbox); */ |
... | @@ -1039,6 +1043,7 @@ mailbox_unix_expunge (mailbox_t mbox) | ... | @@ -1039,6 +1043,7 @@ mailbox_unix_expunge (mailbox_t mbox) |
1039 | { | 1043 | { |
1040 | fclose (tmpfile); | 1044 | fclose (tmpfile); |
1041 | remove (tmpmbox); | 1045 | remove (tmpmbox); |
1046 | free (tmpmbox); | ||
1042 | return ENOLCK; | 1047 | return ENOLCK; |
1043 | } | 1048 | } |
1044 | 1049 | ||
... | @@ -1298,6 +1303,7 @@ mailbox_unix_expunge (mailbox_t mbox) | ... | @@ -1298,6 +1303,7 @@ mailbox_unix_expunge (mailbox_t mbox) |
1298 | remove (tmpmbox); | 1303 | remove (tmpmbox); |
1299 | 1304 | ||
1300 | bailout: | 1305 | bailout: |
1306 | free (tmpmbox); | ||
1301 | /* Release the locks */ | 1307 | /* Release the locks */ |
1302 | if (oflags > 0) | 1308 | if (oflags > 0) |
1303 | fcntl (fileno (mud->file), F_SETFL, oflags); | 1309 | fcntl (fileno (mud->file), F_SETFL, oflags); | ... | ... |
-
Please register or sign in to post a comment