Permalink
Browse files

v_string must be an allocation now

  • Loading branch information...
1 parent 389d4e7 commit 1ab6cb7218ffe1d2a426288d72a157790b271399 @postwait postwait committed Feb 15, 2017
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/noit_message_decoder.c
@@ -184,14 +184,14 @@ int noit_message_decoder_parse_line(const char *payload, int payload_len,
if(vstrlen == 0)
metric->value.v_string = NULL;
else {
- metric->value.v_string = value_str;
+ metric->value.v_string = mtev__strndup(value_str, vstrlen);
}
return 1;
}
if(*payload == 'S' || *payload == 'C' || *payload == 'D') {
metric->type = METRIC_GUESS;
- metric->value.v_string = (char*)payload;
+ metric->value.v_string = NULL;
return 1;
}

0 comments on commit 1ab6cb7

Please sign in to comment.