Commit Diff


commit - 66c889b39514153efd49214703ef06a538eb2ee4
commit + 9a64f34b64fc72344bc88edeb84e88075896744f
blob - 053e136878b01169876161b848bd4dc87fd8ac43
blob + b08fd49d3d915335c9dec2d5e6f038ed7a90a1c0
--- lib/reference.c
+++ lib/reference.c
@@ -204,6 +204,8 @@ parse_ref_file(struct got_reference **ref, const char 
 	}
 	if (fstat(fileno(f), &sb) == -1) {
 		err = got_error_from_errno2("fstat", abspath);
+		if (lock)
+			got_lockfile_unlock(lf, -1);
 		goto done;
 	}
 	if (!S_ISREG(sb.st_mode)) {