diff options
author | Thomas Haller <thaller@redhat.com> | 2016-04-22 09:09:39 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-04-22 14:17:02 +0200 |
commit | 8e59be20d6fcc96de36e72f88e602d91d66c929c (patch) | |
tree | 2ef4aa091889934551d701814df8a652639dce7c | |
parent | cf0c300058722a01898770f1e061ab2dfebf3b71 (diff) | |
download | NetworkManager-8e59be20d6fcc96de36e72f88e602d91d66c929c.tar.gz |
libnm/vpn: gracefully handle empty dirname in _nm_vpn_plugin_info_list_load_dir()
No need to assert against an empty dirname. It's not different from
any other non-existing directory and we should be graceful about that.
-rw-r--r-- | libnm-core/nm-vpn-plugin-info.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libnm-core/nm-vpn-plugin-info.c b/libnm-core/nm-vpn-plugin-info.c index 2e6275e341..07eb52c159 100644 --- a/libnm-core/nm-vpn-plugin-info.c +++ b/libnm-core/nm-vpn-plugin-info.c @@ -253,7 +253,10 @@ _nm_vpn_plugin_info_list_load_dir (const char *dirname, GSList *res = NULL; guint i; - g_return_val_if_fail (dirname && dirname[0], NULL); + g_return_val_if_fail (dirname, NULL); + + if (!dirname[0]) + return NULL; dir = g_dir_open (dirname, 0, NULL); if (!dir) |