Skip to contentSkip to conversation

:Converted usage of malloc, free, strdup to qemu_malloc, qemu_free, qemu_strdup in qemu-sockets.c

PATCH New vibi 1 participant 1 message May 7, 2009

lore
Share & tools
lore

vibi

author
#0 lore raw

PATCH 1/1 :Converted usage of malloc, free, strdup to qemu_malloc, qemu_free, qemu_strdup in qemu-sockets.c

Converted usage of malloc,free,strdup to qemu_malloc,qemu_free,qemu_strdup

---
 qemu-sockets.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
qemu-sockets.c +4 -4
index 4111f82..2f6ab67 100644
@@ -329,10 +329,10 @@ int unix_listen(const char *str, char *ostr, int olen)
     opts = strchr(str, ',');
     if (opts) {
         len = opts - str;
-        path = malloc(len+1);
+        path = qemu_malloc(len+1);
         snprintf(path, len+1, "%.*s", len, str);
     } else
-        path = strdup(str);
+        path = qemu_strdup(str);
 
     memset(&un, 0, sizeof(un));
     un.sun_family = AF_UNIX;
@@ -365,11 +365,11 @@ int unix_listen(const char *str, char *ostr, int olen)
 
     if (sockets_debug)
         fprintf(stderr, "bind(unix:%s): OK\n", un.sun_path);
-    free(path);
+    qemu_free(path);
     return sock;
 
 err:
-    free(path);
+    qemu_free(path);
     closesocket(sock);
     return -1;
 }
Signature · 1 line
1.6.0