Blob Blame History Raw
From 81b5e3780f69e7a3c465afbe6cae9712d47c7deb Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Sat, 25 May 2013 00:52:07 -0400
Subject: [PATCH] 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 file 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,
-- 
1.8.2.1