From: Paul Floyd Date: Sat, 2 Sep 2023 21:43:31 +0000 (+0200) Subject: coverity: fix a couple of forward nulls X-Git-Tag: VALGRIND_3_22_0~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e197de36e1d116294d2f19c4d47fb91a6611208;p=thirdparty%2Fvalgrind.git coverity: fix a couple of forward nulls In the new sized/aligned memcheck code. --- diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 90b89a9115..3f34e3dc19 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -7305,7 +7305,7 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) if (mc && mc->szB != aligned_alloc_info->size) { MC_(record_size_mismatch_error) ( tid, mc, aligned_alloc_info->size, "new/delete"); } - if (aligned_alloc_info->orig_alignment != mc->alignB) { + if (mc && aligned_alloc_info->orig_alignment != mc->alignB) { MC_(record_align_mismatch_error) ( tid, mc, aligned_alloc_info->orig_alignment, "new/delete"); } if (aligned_alloc_info->orig_alignment == 0 || @@ -7318,7 +7318,7 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) if (mc && mc->szB != aligned_alloc_info->size) { MC_(record_size_mismatch_error) ( tid, mc, aligned_alloc_info->size, "new[]/delete[]" ); } - if (aligned_alloc_info->orig_alignment != mc->alignB) { + if (mc && aligned_alloc_info->orig_alignment != mc->alignB) { MC_(record_align_mismatch_error) ( tid, mc, aligned_alloc_info->orig_alignment, "new[]/delete[]"); } if (aligned_alloc_info->orig_alignment == 0 ||