diff --git a/commandline.c b/commandline.c index 689d7735..698bf278 100644 --- a/commandline.c +++ b/commandline.c @@ -714,9 +714,9 @@ int app_server_start(const struct cli_parsed *parsed, void *context) #endif if ((tmp = malloc(PATH_MAX)) == NULL) RETURN(WHY("Out of memory")); - if (get_self_executable_path(tmp, PATH_MAX) == -1) - RETURN(WHY("unable to determine own executable name")); - execpath = tmp; + if (get_self_executable_path(tmp, PATH_MAX) == -1) + RETURN(WHY("unable to determine own executable name")); + execpath = tmp; } /* Create the instance directory if it does not yet exist */ if (create_serval_instance_dir() == -1) diff --git a/overlay_mdp.c b/overlay_mdp.c index f04a8c29..17a79238 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -88,7 +88,7 @@ int overlay_mdp_setup_sockets() } #endif if (mdp_named.poll.fd<=0) { - if (!form_serval_instance_path(&name.sun_path[0], PATH_MAX, "mdp.socket")) + if (!form_serval_instance_path(&name.sun_path[0], sizeof name.sun_path, "mdp.socket")) return WHY("Cannot construct name of unix domain socket."); unlink(&name.sun_path[0]); len = 0+strlen(&name.sun_path[0]) + sizeof(name.sun_family)+1;