From c45be2ecf42b45fe127522ef7fb149d4bcfdf916 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 2 Jan 2015 15:32:47 +0000 Subject: Handle failure to remove or rename. --- desktop/hotlist.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'desktop') 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); -- cgit v1.2.3