From f0ea22a1e22c84affa91ec0e596fbd387d11ff8a Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Wed, 8 Feb 2023 05:16:29 +0100 Subject: [PATCH] MDBF-534: Coverity scan: fix client folder --------------------------------- File: `mysqlbinlog` --------------------------------- - Coverity (FORWARD_NULL): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728438&defectInstanceId=53074517&mergedDefectId=1519690&eventId=53074517-46 `mysqlbinlog` - for `opt_raw_mode` file is set to 0, make sure it opened before. --- client/mysqlbinlog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index aa994df7557..28108922538 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -3169,7 +3169,7 @@ int main(int argc, char** argv) /* Set delimiter back to semicolon */ if (retval != ERROR_STOP) { - if (!stop_event_string.is_empty()) + if (!stop_event_string.is_empty() && result_file) fprintf(result_file, "%s", stop_event_string.ptr()); if (!opt_raw_mode && opt_flashback) fprintf(result_file, "DELIMITER ;\n");