diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-09-13 05:41:52 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-09-13 05:41:52 +0000 |
commit | d7ea96a449049db7de8e92d135b1d961c523a351 (patch) | |
tree | ac14ce6a352fc29baeb03af5c9b8f75d76f349ab /libsylph/procmsg.c | |
parent | d7a5fbadd02bc9e47459c6280cdfd20d18620803 (diff) |
session.c: added extra error checking when writing to buffer.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1155 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/procmsg.c')
-rw-r--r-- | libsylph/procmsg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c index 13141f50..37546154 100644 --- a/libsylph/procmsg.c +++ b/libsylph/procmsg.c @@ -156,10 +156,11 @@ gint procmsg_read_cache_data_str(FILE *fp, gchar **str) #define READ_CACHE_DATA(data, fp) \ { \ if (procmsg_read_cache_data_str(fp, &data) < 0) { \ + g_warning("Cache data is corrupted\n"); \ procmsg_msginfo_free(msginfo); \ procmsg_msg_list_free(mlist); \ - mlist = NULL; \ - break; \ + fclose(fp); \ + return NULL; \ } \ } @@ -171,8 +172,8 @@ gint procmsg_read_cache_data_str(FILE *fp, gchar **str) g_warning("Cache data is corrupted\n"); \ procmsg_msginfo_free(msginfo); \ procmsg_msg_list_free(mlist); \ - mlist = NULL; \ - break; \ + fclose(fp); \ + return NULL; \ } else \ n = idata; \ } |