@pmatilai commented on this pull request.


> +         if (checkForEncoding(pkg->header, 0) != RPMRC_OK) {
+               badenc = 1;
+           }
+       }
+       if (badenc)
+           goto errxit;
+    }
+
+    closeSpec(spec);
+
+exit:
+    return spec;
+
+errxit:
+    if (!secondary)
+       rpmSpecFree(spec);

Indeed. The way it gets called, it probably doesn't matter as 
parseSpecSection() returns an explicit NULL on error, but freeing the struct is 
the responsibility of the caller.

There's also something broken in the error handling: an invalid spec part does 
not abort the build, although an error message can be seen in the log. Do add a 
test for that too, just reuse the same spec but leave a mandatory part out or 
something.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1485#discussion_r1012591860
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/1485/review/1166434...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to