From: Serge Hallyn Date: Mon, 10 Mar 2014 16:59:08 +0000 (-0500) Subject: cgm_destroy: ignore a NULL d->cgroup_path X-Git-Tag: lxc-1.1.0.alpha1~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba3f32cf15d4911fecfd69a01fcbcc1f5c5b9535;p=thirdparty%2Flxc.git cgm_destroy: ignore a NULL d->cgroup_path Depending on where during container creation we failed, cgroup_path may be NULL. Don't try to delete the cgroup in that case. (Also fix a wrong function name in an ERROR message) Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber --- diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c index c80a136e5..4795da43a 100644 --- a/src/lxc/cgmanager.c +++ b/src/lxc/cgmanager.c @@ -438,7 +438,7 @@ static void cgm_destroy(void *hdata) struct cgm_data *d = hdata; int i; - if (!d) + if (!d || !d->cgroup_path) return; if (!cgm_dbus_connect()) { ERROR("Error connecting to cgroup manager"); @@ -703,7 +703,7 @@ static int cgm_do_set(const char *controller, const char *file, if (ret != 0) { NihError *nerr; nerr = nih_error_get(); - ERROR("call to cgmanager_remove_sync failed: %s", nerr->message); + ERROR("call to cgmanager_set_value_sync failed: %s", nerr->message); nih_free(nerr); ERROR("Error setting cgroup %s limit %s", file, cgroup); }