asn1: Fix ENOMEM leak in der_print_bit_string()

This commit is contained in:
Nicolas Williams
2023-01-03 20:38:00 -06:00
parent 26b1acf3b8
commit 20c4c0dea9

View File

@@ -223,7 +223,7 @@ der_print_bit_string(const heim_bit_string *k, int flags)
(void) hex_encode(k->data, k->length / 8, &s);
if (asprintf(&s2, "%llu:%s", (unsigned long long)k->length, s) == -1 || !s2)
return NULL;
s2 = NULL;
free(s);
return s2;
}