Merge branch 'ps/leakfixes-0129'
A few more leakfixes. * ps/leakfixes-0129: scalar: free result of `remote_default_branch()` unix-socket: fix memory leak when chdir(3p) fails
This commit is contained in:
@ -65,8 +65,10 @@ static int unix_sockaddr_init(struct sockaddr_un *sa, const char *path,
|
||||
if (strbuf_getcwd(&cwd))
|
||||
return -1;
|
||||
ctx->orig_dir = strbuf_detach(&cwd, NULL);
|
||||
if (chdir_len(dir, slash - dir) < 0)
|
||||
if (chdir_len(dir, slash - dir) < 0) {
|
||||
FREE_AND_NULL(ctx->orig_dir);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
memset(sa, 0, sizeof(*sa));
|
||||
|
Reference in New Issue
Block a user