free the sshPort to prevent memory leak
This commit is contained in:
parent
1558412cee
commit
fb262fb521
1 changed files with 1 additions and 0 deletions
|
@ -137,6 +137,7 @@ void initService(struct Service *service, const char *arg) {
|
||||||
{
|
{
|
||||||
int size = (tmp - ptr + 1);
|
int size = (tmp - ptr + 1);
|
||||||
free(host);
|
free(host);
|
||||||
|
free(sshPort);
|
||||||
host = malloc(size);
|
host = malloc(size);
|
||||||
memset(host, 0, size);
|
memset(host, 0, size);
|
||||||
memcpy(host, ptr , size - 1);
|
memcpy(host, ptr , size - 1);
|
||||||
|
|
Loading…
Reference in a new issue