From f800a9dc2c36abfb8eb52fe920d2b65549d9d465 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 7 Apr 2013 01:47:07 +0200 Subject: [PATCH] Additional error checking when saving the buffer contents --- src/plugins/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/common.c b/src/plugins/common.c index f978932..eca84d3 100644 --- a/src/plugins/common.c +++ b/src/plugins/common.c @@ -375,7 +375,8 @@ static int _common_task_save_buffer_as(CommonTask * task, char const * filename) return -_common_task_error(task, strerror(errno), 1); } g_free(buf); - fclose(fp); + if(fclose(fp) != 0) + return -_common_task_error(task, strerror(errno), 1); return 0; }