Skip to content

Commit 9c59169

Browse files
committed
Do not use c_str() beyond its scope
Do not use c_str() beyond its scope. It fixes the Coverity issue #449676. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
1 parent bd2b34c commit 9c59169

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/utils/utils_log.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ TEST_F(test, plog_long_error) {
476476
#endif
477477
strerror_ret_static = 0;
478478
helper_test_plog(LOG_DEBUG, "%s", "example log");
479+
strerr = NULL; // do not use tmp.c_str() beyond its scope
479480
}
480481

481482
TEST_F(test, log_pmacros) {

0 commit comments

Comments
 (0)