[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] Fix two memory leaks in parse.c.
From: |
Christopher Brannon |
Subject: |
[PATCH 3/4] Fix two memory leaks in parse.c. |
Date: |
Tue, 8 Jun 2010 10:03:49 -0500 |
Memory was leaked every time we received a SET RATE or SET PAUSE_CONTEXT
command. We should be using TEST_CMD to test for these commands,
as is done for all of the other SET subcommands.
---
src/server/parse.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/server/parse.c b/src/server/parse.c
index 51fbf88..2489a72 100644
--- a/src/server/parse.c
+++ b/src/server/parse.c
@@ -457,7 +457,7 @@ parse_set(const char *buf, const int bytes, const int fd)
if (ret) return strdup(ERR_COULDNT_SET_CLIENT_NAME);
return strdup(OK_CLIENT_NAME_SET);
}
- else if (!strcmp(set_sub, "rate")){
+ else if (TEST_CMD(set_sub, "rate")){
signed int rate;
GET_PARAM_INT(rate, 3);
@@ -550,7 +550,7 @@ parse_set(const char *buf, const int bytes, const int fd)
if (ret) return strdup(ERR_COULDNT_SET_CAP_LET_RECOG);
return strdup(OK_CAP_LET_RECOGN_SET);
}
- else if (!strcmp(set_sub, "pause_context")){
+ else if (TEST_CMD(set_sub, "pause_context")){
int pause_context;
GET_PARAM_INT(pause_context, 3);
--
1.7.1