coccinelle: make use of the "type" FREE_AND_NULL() rule
[gitweb.git] / builtin / unpack-objects.c
index 8bc9997767adbb77cc8af81b2b289e22f2b61c5a..60bfe487893f9ac6c2523242f20ad3d335e3a7fd 100644 (file)
@@ -112,8 +112,7 @@ static void *get_data(unsigned long size)
                        break;
                if (ret != Z_OK) {
                        error("inflate returned %d", ret);
-                       free(buf);
-                       buf = NULL;
+                       FREE_AND_NULL(buf);
                        if (!recover)
                                exit(1);
                        has_errors = 1;