1. Greg Ward
  2. vcprompt

Commits

Greg Ward  committed 995d3ae

git: fix memory leak

  • Participants
  • Parent commits 15ffdd8
  • Branches default

Comments (0)

Files changed (1)

File src/git.c

View file
  • Ignore whitespace
 
     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*