]> git.proxmox.com Git - libgit2.git/commitdiff
Filter: Make sure to release local on error
authorJiri Pospisil <mekishizufu@gmail.com>
Fri, 25 Apr 2014 13:49:26 +0000 (15:49 +0200)
committerJiri Pospisil <mekishizufu@gmail.com>
Fri, 25 Apr 2014 13:49:26 +0000 (15:49 +0200)
src/filter.c

index ff81eb14efe912ec7bf238166d6ddf3a981280e6..b2f57964ae6055af69a198a6e240bfe0e59e23e5 100644 (file)
@@ -617,7 +617,7 @@ int git_filter_list_apply_to_data(
                        si = di; /* swap buffers */
                } else {
                        tgt->size = 0;
-                       return error;
+                       goto cleanup;
                }
        }
 
@@ -625,9 +625,10 @@ int git_filter_list_apply_to_data(
        if (si != 1)
                git_buf_swap(dbuffer[0], dbuffer[1]);
 
+cleanup:
        git_buf_free(&local); /* don't leak if we allocated locally */
 
-       return 0;
+       return error;
 }
 
 int git_filter_list_apply_to_file(