]> git.proxmox.com Git - lxc.git/blame - debian/patches/fixes/0006-storage-rsync-free-memory-on-error.patch
bump version to 3.0.0-3
[lxc.git] / debian / patches / fixes / 0006-storage-rsync-free-memory-on-error.patch
CommitLineData
99be5c8c
WB
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: C0deAi <benjamin.bales@assrc.us>
3Date: Fri, 6 Apr 2018 12:46:53 -0400
4Subject: [PATCH] storage/rsync: free memory on error
5
6Closes #2262.
7
8Signed-off-by: C0deAi <techsupport@mycode.ai>
9Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
10---
11 src/lxc/storage/rsync.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14diff --git a/src/lxc/storage/rsync.c b/src/lxc/storage/rsync.c
15index c3080a56..83871ae8 100644
16--- a/src/lxc/storage/rsync.c
17+++ b/src/lxc/storage/rsync.c
18@@ -73,8 +73,10 @@ int lxc_rsync_exec(const char *src, const char *dest)
19 return -1;
20
21 ret = snprintf(s, l, "%s", src);
22- if (ret < 0 || (size_t)ret >= l)
23+ if (ret < 0 || (size_t)ret >= l) {
24+ free(s);
25 return -1;
26+ }
27
28 s[l - 2] = '/';
29 s[l - 1] = '\0';
30--
312.11.0
32