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:
parent
e95971db0f
commit
200e7ee259
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user