fix memory leak in system DSL function

This commit is contained in:
johnkerl 2019-09-12 21:57:38 -04:00
parent c1e867e234
commit 8aeecabe7a
2 changed files with 6 additions and 1 deletions

View file

@ -455,7 +455,7 @@ mv_t s_s_capitalize_func(mv_t* pval1) {
}
mv_t s_s_system_func(mv_t* pval1) {
char* cmd = mlr_strdup_or_die(pval1->u.strv);
char* cmd = pval1->u.strv;
mv_t retval = mv_from_string_no_free("error-running-system-command");
string_builder_t* psb = sb_alloc(100);
@ -478,6 +478,7 @@ mv_t s_s_system_func(mv_t* pval1) {
retval = mv_from_string_with_free(output_string);
}
sb_free(psb);
mv_free(pval1);
pval1->u.strv = NULL;

View file

@ -9,6 +9,10 @@ TOP OF LIST
quick doc:
* multi-join @ FAQ
* doc/bld note for vgrun oo
- git log; find last release
- git diff -r xxxxx reg_test/run
- export indir=./reg_test/input
- vgrun mlr ...
* sort-within-records
* system()