mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: fix memory leak
get_local_dir() returns the copy of a c-string. It therefore has to be free()d. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a4091189b0
commit
805cd550f2
1 changed files with 3 additions and 1 deletions
|
@ -161,7 +161,9 @@ char *get_local_dir(const char *url, const char *branch)
|
||||||
static char *move_local_cache(struct git_info *info)
|
static char *move_local_cache(struct git_info *info)
|
||||||
{
|
{
|
||||||
char *old_path = get_local_dir(info->url, info->branch);
|
char *old_path = get_local_dir(info->url, info->branch);
|
||||||
return move_away(old_path);
|
char *new_path = move_away(old_path);
|
||||||
|
free(old_path);
|
||||||
|
return new_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_clean(const char *path, unsigned int status, void *payload)
|
static int check_clean(const char *path, unsigned int status, void *payload)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue