From ed0b787392b0df5ee06fc8e73ae4a46f14ade2b1 Mon Sep 17 00:00:00 2001 From: short <> Date: Sun, 23 May 2004 18:57:16 +0000 Subject: [PATCH] Fixed false backups even if the file is not modified. --- src/bundle-util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bundle-util.c b/src/bundle-util.c index 59d1e06..30e1b77 100644 --- a/src/bundle-util.c +++ b/src/bundle-util.c @@ -86,10 +86,12 @@ time_t time_current; g_warning(_("Error reading during the check of file modifications of \"%s\": %m"),pathname); if (close(fd)) g_warning(_("Error closing the file \"%s\" during the check of its modifications: %m"),pathname); - g_free(data_found); - - if (got==(int)data_length && !memcmp(data_found,data,data_length)) + /* memcmp(3) requires 'data_found'! */ + if (got==(int)data_length && !memcmp(data_found,data,data_length)) { + g_free(data_found); return TRUE; + } + g_free(data_found); time_current=time(NULL); /* It is segfault to gmtime(NULL). */ if (!strftime(strftime_buffer,sizeof(strftime_buffer),"GMT%FT%T",gmtime(&time_current))) { -- 1.8.3.1