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".
This commit is contained in:
Jiří Klimeš 2014-12-04 17:45:05 +01:00
parent e52f352339
commit 0da3b96ab5

View file

@ -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;
}
/**