@@ -2745,10 +2745,12 @@ if (certs_resizable) { if (*count != 0) { certs = realloc(certs, sizeof(*certs) * (*count)); } else { + free(certs); + certs = NULL; } } slot->cached_certs = cackey_copy_certs(NULL, certs, *count);