diff options
author | iain <iain@sleepfive.com> | 2012-03-08 16:56:09 +0000 |
---|---|---|
committer | iain <iain@sleepfive.com> | 2012-03-08 16:56:09 +0000 |
commit | 89ef7cd375871eea99f2430d5f17eb2d389ca706 (patch) | |
tree | 9c1c743a22e8414da2f7e6ab80ed86c23c9fbf96 | |
parent | caddbb9e48e0715875631427b02c92fa31d934b6 (diff) |
NULL terminate an array, and return when finding a NULL parent
-rw-r--r-- | src/gypsy-discovery.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gypsy-discovery.c b/src/gypsy-discovery.c index 206bbe9..70788b5 100644 --- a/src/gypsy-discovery.c +++ b/src/gypsy-discovery.c @@ -382,6 +382,10 @@ maybe_add_device (GypsyDiscovery *discovery, parent = g_udev_device_get_parent (parent); } + if (parent == NULL) { + return NULL; + } + property_id = g_udev_device_get_property (parent, "PRODUCT"); if (property_id == NULL) { return NULL; @@ -576,7 +580,7 @@ static void gypsy_discovery_init (GypsyDiscovery *self) { GypsyDiscoveryPrivate *priv = GET_PRIVATE (self); - const char * const subsystems[] = { "tty" }; + const char * const subsystems[] = { "tty", NULL }; self->priv = priv; |