libmm-glib: Initialize result array
In mm_modem_messaging_get_supported_storages(), initialize array to avoid a potential crash with an uninitialized value, and a build failure due to mm-modem-messaging.c:168:24: error: 'array' may be used uninitialized in this function [-Werror=maybe-uninitialized] *n_storages = array->len; https://bugzilla.gnome.org/show_bug.cgi?id=729267
This commit is contained in:

committed by
Aleksander Morgado

parent
0126eb6311
commit
828e2e00eb
@@ -155,7 +155,7 @@ mm_modem_messaging_get_supported_storages (MMModemMessaging *self,
|
||||
MMSmsStorage **storages,
|
||||
guint *n_storages)
|
||||
{
|
||||
GArray *array;
|
||||
GArray *array = NULL;
|
||||
|
||||
g_return_val_if_fail (MM_IS_MODEM_MESSAGING (self), FALSE);
|
||||
g_return_val_if_fail (storages != NULL, FALSE);
|
||||
|
Reference in New Issue
Block a user