From 0da3b96ab5ef1dad9b6c729c1019aeb27d487f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 4 Dec 2014 17:45:05 +0100 Subject: [PATCH] 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". --- libnm-core/nm-setting-8021x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } /**