Commits

Greg Ward  committed 995d3ae

git: fix memory leak

  • Participants
  • Parent commits 15ffdd8

Comments (0)

Files changed (1)

 
     if (!read_first_line(".git/HEAD", buf, 1024)) {
         debug("unable to read .git/HEAD: assuming not a git repo");
-        return NULL;
+        goto err;
     }
 
     char *prefix = "ref: refs/heads/";
     }
 
     return result;
+
+ err:
+    free_result(result);
+    return NULL;
 }
 
 vccontext_t*