Skip to contentSkip to conversation

qemu-sockets: use qapi_free_SocketAddress in cleanup

PATCH Applied [email protected] 4 participants 4 messages Jul 6, 2016 – Jul 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-sockets: use qapi_free_SocketAddress in cleanup

From: Marc-André Lureau <[email protected]>

Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that may leak some linked data.

---
 util/qemu-sockets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/qemu-sockets.c +1 -1
index fb83d48..777af49 100644
@@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
         }
     }
 
-    g_free(addr);
+    qapi_free_SocketAddress(addr);
 }
 
 int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On 07/06/2016 10:42 AM, [email protected] wrote:

From: Marc-André Lureau <[email protected]>

Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that may leak some linked data.

---
 util/qemu-sockets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
util/qemu-sockets.c +1 -1
index fb83d48..777af49 100644
@@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
         }
     }
 
-    g_free(addr);
+    qapi_free_SocketAddress(addr);
 }
 
 int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 6 lines · On 2016/7/7 0:42, [email protected] wrote:

From: Marc-André Lureau <[email protected]>

Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that may leak some linked data.

I'm planing to send a patch, then I find this :)

Quoted 18 lines
---
 util/qemu-sockets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/qemu-sockets.c +1 -1
index fb83d48..777af49 100644
@@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
         }
     }
 
-    g_free(addr);
+    qapi_free_SocketAddress(addr);
 }
 
 int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
Signature · 1 line
Shannon
#3 lore raw
In reply to [email protected]
Quoted 16 lines · On 06/07/2016 18:42, [email protected] wrote:

From: Marc-André Lureau <[email protected]>

Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that may leak some linked data.

---
 util/qemu-sockets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/qemu-sockets.c +0 -0
index fb83d48..777af49 100644

util/qemu-sockets.c void socket_listen_cleanup(int fd, Error **errp) · line 1018

Quoted 8 lines
util/qemu-sockets.c +1 -1
@@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
         }
     }
 
-    g_free(addr);
+    qapi_free_SocketAddress(addr);
 }
 
 int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)

Queued, thanks.

Paolo