Skip to content
Snippets Groups Projects
Commit 38dc0745 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

Move NULL check before pointer use

Coverity scan #742136 (dereference before null check)
parent cdf86bc7
No related branches found
No related tags found
No related merge requests found
......@@ -446,13 +446,14 @@ static int test_edns_add_option()
*/
for (int i = 0; i < TEST_EDNS; i++) {
knot_opt_rr_t *edns = knot_edns_new();
assert(edns->option_count == 0);
if (edns == NULL) {
ERR_ALLOC_FAILED;
return 0;
}
assert(edns->option_count == 0);
for (int j = 0; j < test_edns_data[i].option_count; j++) {
if (knot_edns_add_option(edns,
test_edns_data[i].options[j].code,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment