diff options
author | Richard Hughes <richard@hughsie.com> | 2015-05-28 12:44:14 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-05-28 12:44:14 +0100 |
commit | dec305158afd963ba32d59211ef65543867feab2 (patch) | |
tree | 9dbc4391361b93b4771235f8c368c9346de02d58 | |
parent | 9dc1ab93dbd76f09d96a163f8df80451b5e1e8af (diff) | |
download | appstream-glib-dec305158afd963ba32d59211ef65543867feab2.tar.gz |
Fix a potential crash spotted by clang
-rw-r--r-- | libappstream-glib/as-node.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libappstream-glib/as-node.c b/libappstream-glib/as-node.c index 0d3419d..f8073b9 100644 --- a/libappstream-glib/as-node.c +++ b/libappstream-glib/as-node.c @@ -899,6 +899,8 @@ as_node_get_child_node (const GNode *root, const gchar *name, GNode *node; /* invalid */ + if (root == NULL) + return NULL; if (name == NULL || name[0] == '\0') return NULL; |