diff options
-rw-r--r-- | desktop/hotlist.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c index 512eb3ae3..212d6309a 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -937,8 +937,14 @@ static nserror hotlist_save(const char *path) } /* Remove old hotlist file, and replace */ - remove(path); - rename(temp_path, path); + if (remove(path) != 0) { + res = NSERROR_SAVE_FAILED; + goto cleanup; + } + if (rename(temp_path, path) != 0) { + res = NSERROR_SAVE_FAILED; + goto cleanup; + } cleanup: free(temp_path); |