Skip to content

Commit a413be1

Browse files
committed
remove null assignment, add null check
1 parent b34fd2f commit a413be1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tests/api.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19617,10 +19617,12 @@ static int test_wolfSSL_i2c_ASN1_INTEGER(void)
1961719617
ExpectNotNull(pp = (unsigned char*)XMALLOC(ret + 1, NULL,
1961819618
DYNAMIC_TYPE_TMP_BUFFER));
1961919619
tpp = pp;
19620-
ExpectNotNull(XMEMSET(tpp, 0, ret + 1));
19621-
ExpectIntEQ(i2c_ASN1_INTEGER(a, &tpp), 1);
19622-
tpp--;
19623-
ExpectIntEQ(*tpp, 40);
19620+
if (tpp != NULL) {
19621+
ExpectNotNull(XMEMSET(tpp, 0, ret + 1));
19622+
ExpectIntEQ(i2c_ASN1_INTEGER(a, &tpp), 1);
19623+
tpp--;
19624+
ExpectIntEQ(*tpp, 40);
19625+
}
1962419626
XFREE(pp, NULL, DYNAMIC_TYPE_TMP_BUFFER);
1962519627
pp = NULL;
1962619628

@@ -40388,7 +40390,6 @@ static int test_wolfSSL_OPENSSL_hexstr2buf(void)
4038840390
ExpectIntEQ(expectedOutputs[i].buffer[j], returnedBuf[j]);
4038940391
}
4039040392
OPENSSL_free(returnedBuf);
40391-
returnedBuf = NULL;
4039240393
}
4039340394
#endif
4039440395
return EXPECT_RESULT();

0 commit comments

Comments
 (0)