From 8c3e3ebe24e442eb4317875b2e54d2fe2a8bf6ab Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Fri, 3 Oct 2014 23:41:30 -0400 Subject: [PATCH] fix blocklist saving bug --- src/friendlist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/friendlist.c b/src/friendlist.c index 1308ba0..39d5706 100644 --- a/src/friendlist.c +++ b/src/friendlist.c @@ -167,10 +167,11 @@ static int save_blocklist(char *path) if (fp == NULL) goto on_error; - if (fwrite(data, len, 1, fp) == 1) + if (fwrite(data, len, 1, fp) != 1) goto on_error; fclose(fp); + free(data); return 0; on_error: