summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2014-12-04 17:45:05 +0100
committerJiří Klimeš <jklimes@redhat.com>2014-12-05 09:38:40 +0100
commit0da3b96ab5ef1dad9b6c729c1019aeb27d487f0a (patch)
tree096902460d181eae48286d0827a4245abfff9076
parente52f352339f272987c415ba1512f3b9fbcb92509 (diff)
downloadNetworkManager-0da3b96ab5ef1dad9b6c729c1019aeb27d487f0a.tar.gz
libnm-core: do not access array if it is NULL
Coverity: Defect type: FORWARD_NULL libnm-core/nm-setting-8021x.c:1684: var_deref_op: Dereferencing null pointer "array".
-rw-r--r--libnm-core/nm-setting-8021x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libnm-core/nm-setting-8021x.c b/libnm-core/nm-setting-8021x.c
index 369359f47a..f739f2c720 100644
--- a/libnm-core/nm-setting-8021x.c
+++ b/libnm-core/nm-setting-8021x.c
@@ -1680,8 +1680,9 @@ file_to_secure_bytes (const char *filename)
g_byte_array_append (array, (guint8 *) contents, length);
g_assert (array->len == length);
g_free (contents);
+ return g_bytes_new_with_free_func (array->data, array->len, free_secure_bytes, array);
}
- return g_bytes_new_with_free_func (array->data, array->len, free_secure_bytes, array);
+ return NULL;
}
/**