Fix memory leak in new split_string* functions.

This commit is contained in:
Jon Siwek 2015-02-02 11:14:24 -06:00
parent f82adb724c
commit 21c7642f62
3 changed files with 6 additions and 2 deletions

View file

@ -341,7 +341,7 @@ static int match_prefix(int s_len, const char* s, int t_len, const char* t)
VectorVal* do_split_string(StringVal* str_val, RE_Matcher* re, int incl_sep,
int max_num_sep)
{
VectorVal* rval = new VectorVal(new VectorType(base_type(TYPE_STRING)));
VectorVal* rval = new VectorVal(string_vec);
const u_char* s = str_val->Bytes();
int n = str_val->Len();
const u_char* end_of_s = s + n;