coccinelle: make use of the "type" FREE_AND_NULL() rule
[gitweb.git] / fast-import.c
index 9a22fc92c0d029cf2a1362ea846f75f59978e870..eeab927d5ab9f8bca61e68ef3fe29b565a11fdc1 100644 (file)
@@ -1063,8 +1063,7 @@ static void end_packfile(void)
                close(pack_data->pack_fd);
                unlink_or_warn(pack_data->pack_name);
        }
-       free(pack_data);
-       pack_data = NULL;
+       FREE_AND_NULL(pack_data);
        running = 0;
 
        /* We can't carry a delta across packfiles. */
@@ -1149,8 +1148,7 @@ static int store_object(
 
                /* We cannot carry a delta into the new pack. */
                if (delta) {
-                       free(delta);
-                       delta = NULL;
+                       FREE_AND_NULL(delta);
 
                        git_deflate_init(&s, pack_compression_level);
                        s.next_in = (void *)dat->buf;