From b91d029021552100599db60bc7259efbef1d71a8 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 23 Sep 2013 09:44:32 -0400 Subject: [PATCH] core: short-circuit nm_device_spec_match_list() If there are no specs, then the device can't match, so don't call the virtual method (which might do work like building comparison strings even when the list is empty). --- src/devices/nm-device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 8489e05358..d40457b4f4 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6347,6 +6347,9 @@ nm_device_spec_match_list (NMDevice *device, const GSList *specs) { g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + if (!specs) + return FALSE; + return NM_DEVICE_GET_CLASS (device)->spec_match_list (device, specs); }