[discident-glib] ean: NULL-ify return values



commit 595e8597985313e2032d6dbcd56308884e7887c6
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Dec 21 17:29:20 2015 +0100

    ean: NULL-ify return values
    
    Out parameters in discident_ean_lookup_sync() should be zero'ed out so
    that they're not undefined pointers when the function returns.
    
    Fixes a crash in the test suite.

 discident-glib/discident-ean-glib.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/discident-glib/discident-ean-glib.c b/discident-glib/discident-ean-glib.c
index b8d4f64..9596649 100644
--- a/discident-glib/discident-ean-glib.c
+++ b/discident-glib/discident-ean-glib.c
@@ -217,6 +217,11 @@ discident_ean_lookup_sync (DiscidentEan *ean,
                           char        **img_url,
                           GError      **error)
 {
+       if (img_url)
+               *img_url = NULL;
+       if (title)
+               *title = NULL;
+
        if (g_str_has_prefix (ean->priv->service, "rl-")) {
                return discident_ean_rl_lookup_sync (ean,
                                                     barcode,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]