free the sshPort to prevent memory leak

This commit is contained in:
Alexandru Bogdan Stefan 2016-05-05 15:31:30 +03:00
parent 1558412cee
commit fb262fb521

View file

@ -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);