aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-18 02:07:42 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-18 02:07:42 +0200
commit6ca8c2a0c00577c04f3df5b03fc327525fba579d (patch)
treeb5e64a1165a49c78cf73a4e7ff233c18fc391360
parentm doc (diff)
downloadmds-6ca8c2a0c00577c04f3df5b03fc327525fba579d.tar.gz
mds-6ca8c2a0c00577c04f3df5b03fc327525fba579d.tar.bz2
mds-6ca8c2a0c00577c04f3df5b03fc327525fba579d.tar.xz
do not duplicate interception condition string before it is necessary
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-server/mds-server.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mds-server/mds-server.c b/src/mds-server/mds-server.c
index 93849ff..5f5eb10 100644
--- a/src/mds-server/mds-server.c
+++ b/src/mds-server/mds-server.c
@@ -1022,12 +1022,6 @@ void add_intercept_condition(client_t* client, char* condition, int64_t priority
size_t hash;
size_t i;
- if ((condition = strdup(condition)) == NULL)
- {
- perror(*argv);
- return;
- }
-
/* Split header and value apart. */
if ((value = strchr(header, ':')) != NULL)
{
@@ -1094,6 +1088,13 @@ void add_intercept_condition(client_t* client, char* condition, int64_t priority
eprint("client tried to stop intercepting messages that it does not intercept.");
else
{
+ /* Duplicate condition string. */
+ if ((condition = strdup(condition)) == NULL)
+ {
+ perror(*argv);
+ return;
+ }
+
/* Grow the interception condition list. */
if (conds == NULL)
conds = malloc(1 * sizeof(interception_condition_t));