summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-11-25 08:57:55 -0500
committerKeith Bostic <keith@wiredtiger.com>2015-11-25 08:57:55 -0500
commitbc1301ad7b99677a00fef52e109a85fb5b1996b2 (patch)
tree7a36e82f8a1f1ede982c355a5df7c07f2d2a63be /ext
parent1e094eeee8e353e93bf800ae4f897449b72adece (diff)
downloadmongo-bc1301ad7b99677a00fef52e109a85fb5b1996b2.tar.gz
WT-2234: Coverity 1339897: Resource leaks (RESOURCE_LEAK)
Diffstat (limited to 'ext')
-rw-r--r--ext/extractors/csv/csv_extractor.c4
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);