]> git.proxmox.com Git - mirror_lxcfs.git/commit
fix leak in realloc loop in must_strcat_pid
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 7 Jan 2016 11:59:53 +0000 (12:59 +0100)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 7 Jan 2016 19:13:27 +0000 (11:13 -0800)
commit1c4be29a9f9f1797da00efdeb584bce4bc4ef05c
tree09942785a3767ab46b341726b3a04f7a622f122d
parent257f639baeab38f607ebb10db7ea6da0e5eba777
fix leak in realloc loop in must_strcat_pid

If the first realloc() call fails then 'd' becomes NULL,
subsequent realloc() retries will behave like malloc() and
the the original src pointer is never freed. Further more
the newly allocated data then contains uninitialized data
where the previous pids had been stored.
Avoid this by passing the the original pointer from '*src'
to realloc().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lxcfs.c