~pedro/fido2-webauthn-client

084309c47c55f9d5b11bb2b9d844efa765120cda — pedro martelletto 5 months ago 084fa63 master
plug a mem leak in cbor_pack_item()
1 files changed, 4 insertions(+), 2 deletions(-)

M cbor.c
M cbor.c => cbor.c +4 -2
@@ 37,11 37,13 @@ cbor_pack_item(const char *key, cbor_item_t **item)
	    (p->key = cbor_build_string(key)) == NULL ||
	    *item == NULL) {
		warnx("%s: %s", __func__, key);
		if (*item)
			cbor_decref(item);
		free_pair(&p);
		return NULL;
	} else {
		p->value = *item;
	}

	p->value = *item;
	*item = NULL;

	return p;