From: Ben Pfaff Date: Fri, 23 Mar 2012 20:42:12 +0000 (-0700) Subject: unixctl: Fix bad log message on error path. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=5708fd1fc09fb2b23ce12ef7c94e579715c23c02;hp=bc33a059cd54770ace1e64f5ce200622c764d02b;p=sliver-openvswitch.git unixctl: Fix bad log message on error path. 'path' is usually not the right path (often it's NULL). Introduced in commit bde9f75de (unixctl: New JSON RPC back-end.). Signed-off-by: Ben Pfaff --- diff --git a/lib/unixctl.c b/lib/unixctl.c index 054ce49c0..d8974c9e4 100644 --- a/lib/unixctl.c +++ b/lib/unixctl.c @@ -222,12 +222,9 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp) } error = pstream_open(punix_path, &listener); - free(punix_path); - punix_path = NULL; - if (error) { - ovs_error(error, "could not initialize control socket %s", path); - return error; + ovs_error(error, "could not initialize control socket %s", punix_path); + goto exit; } unixctl_command_register("help", "", 0, 0, unixctl_help, NULL); @@ -237,7 +234,10 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp) server->listener = listener; list_init(&server->conns); *serverp = server; - return 0; + +exit: + free(punix_path); + return error; } static void