commit - 25054c242b7401a2a20e3c8b87f0a7d61d568909
commit + 04cdf6acc3e2bb972d4948a12406ab5d348d4760
blob - 193f1d3e3cf6366ab7379ecac4d61e5aaabafeb5
blob + fb69531b2970591164a171b0a1d1a72f3c97c819
--- lib/patch.c
+++ lib/patch.c
err = copy(tmp, orig, copypos, -1);
done:
- if (orig != NULL)
- fclose(orig);
+ if (orig != NULL && fclose(orig) == EOF && err == NULL)
+ err = got_error_from_errno("fclose");
return err;
}
free(template);
if (tmppath != NULL)
unlink(tmppath);
- if (tmp != NULL)
- fclose(tmp);
+ if (tmp != NULL && fclose(tmp) == EOF && err == NULL)
+ err = got_error_from_errno("fclose");
free(tmppath);
free(oldpath);
free(newpath);