Skip to content

Commit

Permalink
WT-1991: clear the returned WT_CURSOR reference if we closed the cursor,
Browse files Browse the repository at this point in the history
there's no additional work for our caller to do.
  • Loading branch information
keithbostic committed Jul 3, 2015
1 parent 9897eb2 commit e34292d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/session/session_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ __wt_open_cursor(WT_SESSION_IMPL *session,
* copied.
*/
if ((*cursorp)->uri == NULL &&
(ret = __wt_strdup(session, uri, &(*cursorp)->uri)) != 0)
(ret = __wt_strdup(session, uri, &(*cursorp)->uri)) != 0) {
WT_TRET((*cursorp)->close(*cursorp));
*cursorp = NULL;
}

return (ret);
}
Expand Down

0 comments on commit e34292d

Please sign in to comment.