[vino] Be more careful with memory allocation



commit 81b5e3780f69e7a3c465afbe6cae9712d47c7deb
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 25 00:52:07 2013 -0400

    Be more careful with memory allocation
    
    Better to 0-initialize these structs, since GetValidIGD may
    not end up filling them.
    See https://bugzilla.redhat.com/attachment.cgi?id=707491
    for a related stacktrace.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700987

 server/vino-upnp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/server/vino-upnp.c b/server/vino-upnp.c
index fcccfc7..99d7a71 100644
--- a/server/vino-upnp.c
+++ b/server/vino-upnp.c
@@ -91,8 +91,8 @@ update_upnp_status (VinoUpnp *upnp)
   dprintf (UPNP, "found.\n");
   dprintf (UPNP, "UPnP: Looking for a valid IGD... ");
 
-  upnp->priv->urls = g_new (struct UPNPUrls, 1);
-  upnp->priv->data = g_new (struct IGDdatas, 1);
+  upnp->priv->urls = g_new0 (struct UPNPUrls, 1);
+  upnp->priv->data = g_new0 (struct IGDdatas, 1);
 
   res = UPNP_GetValidIGD (devlist,
                          upnp->priv->urls,


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