From: short <> Date: Sun, 23 May 2004 18:57:16 +0000 (+0000) Subject: Fixed false backups even if the file is not modified. X-Git-Tag: udpgate-1_0~28 X-Git-Url: https://git.jankratochvil.net/?p=udpgate.git;a=commitdiff_plain;h=ed0b787392b0df5ee06fc8e73ae4a46f14ade2b1 Fixed false backups even if the file is not modified. --- 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))) {