]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-user-nic: fix memleak
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 26 Aug 2017 21:10:18 +0000 (23:10 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 27 Aug 2017 15:51:31 +0000 (17:51 +0200)
commit8285dcfb504e02520c9b4cac395dd5a45b1b08d5
tree9d7c7f114ad0a7435a5f7a93852316558f52d5cc
parentd04e77c34a445dd9caee2a50a5c948e7af706d55
lxc-user-nic: fix memleak

get_new_nicname() calls lxc_mkifname() which allocates memory and returns it to
the caller. The way get_new_nicname() and get_nic_if_avail() were implemented
they hid that fact by returning a boolean. That doesn't make sense. Let's
rather have them return a pointer to the allocated nic name which the caller
needs to free.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxc_user_nic.c