mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-19 09:24:14 +00:00
fix memory leak on string-to-number in put/filter
This commit is contained in:
parent
ae0eb7861b
commit
11d51cf291
1 changed files with 3 additions and 1 deletions
|
|
@ -215,6 +215,7 @@ void mv_get_int_nullable(mv_t* pval) {
|
|||
|
||||
// ----------------------------------------------------------------
|
||||
void mv_get_number_nullable(mv_t* pval) {
|
||||
char* strv = NULL;
|
||||
switch (pval->type) {
|
||||
case MT_NULL:
|
||||
break;
|
||||
|
|
@ -229,8 +230,9 @@ void mv_get_number_nullable(mv_t* pval) {
|
|||
pval->u.intv = 0;
|
||||
break;
|
||||
case MT_STRING:
|
||||
// xxx freeing ...
|
||||
strv = pval->u.strv;
|
||||
*pval = mv_scan_number_nullable(pval->u.strv);
|
||||
free(strv);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "%s: internal coding error detected at file %s, line %d.\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue