team: fix potential crash if team binary doesn't exist

warning: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error')
   #   552|   			if (!teamd_kill (self, NULL, &error)) {
   #   553|-> 				_LOGW (LOGD_TEAM, "existing teamd config mismatch; failed to kill existing teamd: %s", error->message);
   #   554|   				*reason = NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED;

Fixes: 24a764e831
(cherry picked from commit 4fa01c7dc9)
This commit is contained in:
Thomas Haller 2015-06-25 18:16:55 +02:00
parent 9d0c9733a5
commit 35ea2389be

View file

@ -428,7 +428,7 @@ teamd_kill (NMDeviceTeam *self, const char *teamd_binary, GError **error)
gs_free char *tmp_str = NULL;
if (!teamd_binary) {
teamd_binary = nm_utils_find_helper ("teamd", NULL, NULL);
teamd_binary = nm_utils_find_helper ("teamd", NULL, error);
if (!teamd_binary) {
_LOGW (LOGD_TEAM, "Activation: (team) failed to start teamd: teamd binary not found");
return FALSE;