summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2014-04-30 15:57:30 +0200
committerAleksander Morgado <aleksander@aleksander.es>2014-05-05 20:47:55 +0200
commit828e2e00eb8e4ced54ec51fb61bfdb37df526935 (patch)
treeec387147df5e097309982cf71ec1743f3193d4ba
parent0126eb63114ddd5099a4f63dac67e190ccd00706 (diff)
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
-rw-r--r--libmm-glib/mm-modem-messaging.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmm-glib/mm-modem-messaging.c b/libmm-glib/mm-modem-messaging.c
index fdf14978..c6191949 100644
--- a/libmm-glib/mm-modem-messaging.c
+++ b/libmm-glib/mm-modem-messaging.c
@@ -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);