Fixed false backups even if the file is not modified.
authorshort <>
Sun, 23 May 2004 18:57:16 +0000 (18:57 +0000)
committershort <>
Sun, 23 May 2004 18:57:16 +0000 (18:57 +0000)
src/bundle-util.c

index 59d1e06..30e1b77 100644 (file)
@@ -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))) {