Fix memory leaks. (#2530)

fixes #2529
This commit is contained in:
Ingo Bürk
2016-11-03 08:18:18 +01:00
committed by Michael Stapelberg
parent 7ad5736875
commit fea0bc1a45
2 changed files with 5 additions and 1 deletions

View File

@ -206,7 +206,7 @@ int main(int argc, char *argv[]) {
}
if (!payload)
payload = "";
payload = sstrdup("");
int sockfd = socket(AF_LOCAL, SOCK_STREAM, 0);
if (sockfd == -1)
@ -221,6 +221,7 @@ int main(int argc, char *argv[]) {
if (ipc_send_message(sockfd, strlen(payload), message_type, (uint8_t *)payload) == -1)
err(EXIT_FAILURE, "IPC: write()");
free(payload);
if (quiet)
return 0;