1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

save_textarea_file: don't return a dangling pointer if open fails

If fdopen failed, save_textarea_file would free the filename, but it still returned the pointer to the filename.  With this commit, save_textarea_file will return NULL if fdopen fails.
This commit is contained in:
Miciah Dashiel Butler Masters 2008-05-21 20:21:59 +00:00
parent e95971db0f
commit 200e7ee259

View File

@ -305,7 +305,7 @@ save_textarea_file(unsigned char *value)
fwrite(value, strlen(value), 1, file);
fclose(file);
} else {
mem_free(filename);
mem_free_set(&filename, NULL);
}
return filename;