janssonrpc-c: fix shared memory leak on notification requests 843/head
authorEmmanuel Schmidbauer <emmanuel@getweave.com>
Wed, 2 Nov 2016 14:15:49 +0000 (10:15 -0400)
committerEmmanuel Schmidbauer <emmanuel@getweave.com>
Wed, 2 Nov 2016 14:15:49 +0000 (10:15 -0400)
modules/janssonrpc-c/janssonrpc_io.c

index 036032e..a25e40d 100644 (file)
@@ -534,6 +534,8 @@ void cmd_pipe_cb(int fd, short event, void *arg)
                WARN("%s could not be sent to connection group: %.*s\n",
                                type, STR(req_cmd->conn));
                fail_request(JRPC_ERR_SEND, req, "Failed to send request");
+       } else if (req_cmd->notify_only == true) { // free notification requests if they are sent
+               free_req_cmd(req_cmd);
        }
 
 end: