The third parameter of unix_listen in the line:

int fd = unix_listen(path, NULL, strlen(path));

makes an unnecessary call to strlen. That parameter will not be used unless
the second parameter is not NULL, which is not the case here.
---
 qga/channel-posix.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 57eea06..ba9c8a6 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -181,7 +181,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar 
*path, GAChannelMethod
         break;
     }
     case GA_CHANNEL_UNIX_LISTEN: {
-        int fd = unix_listen(path, NULL, strlen(path));
+        int fd = unix_listen(path, NULL, 0);
         if (fd == -1) {
             g_critical("error opening path: %s", strerror(errno));
             return false;
-- 
1.7.9.5


Reply via email to