diff options
-rw-r--r-- | ext/extractors/csv/csv_extractor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/extractors/csv/csv_extractor.c b/ext/extractors/csv/csv_extractor.c index 8d50cc7ec5d..0d501fefb57 100644 --- a/ext/extractors/csv/csv_extractor.c +++ b/ext/extractors/csv/csv_extractor.c @@ -97,8 +97,10 @@ csv_extract(WT_EXTRACTOR *extractor, WT_SESSION *session, strncpy(copy, p, len); copy[len] = '\0'; if (csv_extractor->format_isnum) { - if ((val = atoi(copy)) < 0) + if ((val = atoi(copy)) < 0) { + free(copy); return (EINVAL); + } result_cursor->set_key(result_cursor, val); } else result_cursor->set_key(result_cursor, copy); |