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

@ -1,4 +1,8 @@
2.3-405 | 2015-02-02 11:14:24 -0600
* Fix memory leak in new split_string* functions. (Jon Siwek)
2.3-404 | 2015-01-30 14:23:27 -0800 2.3-404 | 2015-01-30 14:23:27 -0800
* Update documentation (broken links, outdated tests). (Jon Siwek) * Update documentation (broken links, outdated tests). (Jon Siwek)

View file

@ -1 +1 @@
2.3-404 2.3-405

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, VectorVal* do_split_string(StringVal* str_val, RE_Matcher* re, int incl_sep,
int max_num_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(); const u_char* s = str_val->Bytes();
int n = str_val->Len(); int n = str_val->Len();
const u_char* end_of_s = s + n; const u_char* end_of_s = s + n;