diff options
author | Don Anderson <dda@mongodb.com> | 2017-03-16 23:45:17 -0400 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2017-03-17 14:45:17 +1100 |
commit | 4e47a53801a7bd54e323d9899905a69340ed8dfb (patch) | |
tree | ce6b55a8db5679a8832d776d23387023596caee8 | |
parent | c9b353c33631725e633e146f87c1c92e32a5def3 (diff) | |
download | mongo-4e47a53801a7bd54e323d9899905a69340ed8dfb.tar.gz |
WT-3212 Table cursors should not free memory owned by the table. (#3327)
-rw-r--r-- | src/cursor/cur_table.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cursor/cur_table.c b/src/cursor/cur_table.c index 98dbbec8981..72eec177449 100644 --- a/src/cursor/cur_table.c +++ b/src/cursor/cur_table.c @@ -1015,11 +1015,15 @@ __wt_curtable_open(WT_SESSION_IMPL *session, if (0) { err: if (*cursorp != NULL) { - if (*cursorp != cursor) - WT_TRET(__wt_cursor_close(*cursorp)); + /* + * When a dump cursor is opened, then *cursorp, not + * cursor, is the dump cursor. Close the dump cursor, + * and the table cursor will be closed as its child. + */ + cursor = *cursorp; *cursorp = NULL; } - WT_TRET(__curtable_close(cursor)); + WT_TRET(cursor->close(cursor)); } __wt_scr_free(session, &tmp); |