Summary:
Fix a bug where a rare/unexpected API call could potentially cause a minor problem in error handling.
=======================
Coverity analysis defect 113991: Possible failure to restore non-local value
Handles classes of flow where a function is either saving some external value, modifying the external value, and then possibly intending to restore it to its original state but not doing so along one of many paths; or else is checking whether an external has some expected value, modifying the external value, then possibly intending to restore it to the expected value but not doing so along a path. Such code is only incorrect if the intent really was to restore along all paths.
Defect 113991 (STATIC_C)
Checker MISSING_RESTORE (subcategory possible)
File: /src/cursor/cur_backup.c
Function __curbackup_reset
/src/cursor/cur_backup.c, line: 60
Saving non-local "session->dhandle" in local "__olddh".
CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, reset, NULL);
/src/cursor/cur_backup.c, line: 60
Modifying non-local "session->dhandle".
CURSOR_API_CALL_PREPARE_ALLOWED(cursor, session, reset, NULL);
/src/cursor/cur_backup.c, line: 61
Value of non-local "session->dhandle" that was saved in "__olddh" is not restored as it was along other paths.
WT_CURSOR_BACKUP_CHECK_STOP(cb);
- related to
-
WT-5326 Coverity issues in cur_backup and cur_backup_incr
- Closed