I am sorry for being late to the review, I looked into coverity today as Duy
bugged me to fix the memory allocation stuff[1]
[1] $gmane/275046
On Thu, Jul 30, 2015 at 11:06 PM, David Turner [off-list ref] wrote:
+
+ if (old_sha1) {
+ unsigned char actual_old_sha1[20];
+ read_ref(pseudoref, actual_old_sha1);
What about the return value of read_ref?
In most cases of the code base (19/21) we check the return of that.
So maybe
if (read_ref(pseudoref, actual_old_sha1) <0)
die("Could not read ref %s", pseudoref);
+ if (fd < 0)
+ die_errno(_("Could not open '%s' for writing"), filename);
+ read_ref(pseudoref, actual_old_sha1);
same here.