Merge branch 'jc/rerere-multi'
authorJunio C Hamano <gitster@pobox.com>
Mon, 23 May 2016 21:54:37 +0000 (14:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 May 2016 21:54:38 +0000 (14:54 -0700)
* jc/rerere-multi:
  rerere: remove an null statement
  rerere: plug memory leaks upon "rerere forget" failure

1  2 
rerere.c

diff --cc rerere.c
+++ b/rerere.c
@@@ -1060,14 -1062,19 +1060,19 @@@ static int rerere_forget_one_path(cons
                        break;
        }
  
-       if (id->collection->status_nr <= id->variant)
-               return error("no remembered resolution for '%s'", path);
+       if (id->collection->status_nr <= id->variant) {
+               error("no remembered resolution for '%s'", path);
+               goto fail_exit;
+       }
  
        filename = rerere_path(id, "postimage");
-       if (unlink(filename))
-               return (errno == ENOENT
-                       ? error("no remembered resolution for %s", path)
-                       : error_errno("cannot unlink %s", filename));
+       if (unlink(filename)) {
+               if (errno == ENOENT)
+                       error("no remembered resolution for %s", path);
+               else
 -                      error("cannot unlink %s: %s", filename, strerror(errno));
++                      error_errno("cannot unlink %s", filename);
+               goto fail_exit;
+       }
  
        /*
         * Update the preimage so that the user can resolve the