mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-02 23:04:52 +00:00
storage/rsync: free memory on error
Closes #2262. Signed-off-by: C0deAi <techsupport@mycode.ai> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
125a2e044c
commit
55d83a7c72
@ -73,8 +73,10 @@ int lxc_rsync_exec(const char *src, const char *dest)
|
||||
return -1;
|
||||
|
||||
ret = snprintf(s, l, "%s", src);
|
||||
if (ret < 0 || (size_t)ret >= l)
|
||||
if (ret < 0 || (size_t)ret >= l) {
|
||||
free(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
s[l - 2] = '/';
|
||||
s[l - 1] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user