openocd: fix simple cases of NULL comparison
[fw/openocd] / src / jtag / aice / aice_transport.c
index df399f816aadeef978c1e6894ee1b4806ab52e61..3e9d94219754e06f4c91937d3a75f90b8773bd66 100644 (file)
@@ -43,7 +43,7 @@ static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi
 
        unsigned expected_len = sizeof(uint32_t) * tap->expected_ids_cnt;
        uint32_t *new_expected_ids = malloc(expected_len + sizeof(uint32_t));
-       if (new_expected_ids == NULL) {
+       if (!new_expected_ids) {
                Jim_SetResultFormatted(goi->interp, "no memory");
                return JIM_ERR;
        }