From 986b811b3d72547847fb946c7c2857633848644e Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 6 Feb 2023 09:29:44 +0000 Subject: [PATCH] trivial: Fix a tiny coverity-spotted memory leak on error --- plugins/tpm/fu-tpm-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/tpm/fu-tpm-device.c b/plugins/tpm/fu-tpm-device.c index e51e45dd7..cc4e5b740 100644 --- a/plugins/tpm/fu-tpm-device.c +++ b/plugins/tpm/fu-tpm-device.c @@ -42,11 +42,12 @@ void fu_tpm_device_add_checksum(FuTpmDevice *self, guint idx, const gchar *checksum) { FuTpmDevicePrivate *priv = GET_PRIVATE(self); - FuTpmDevicePcrItem *item = g_new0(FuTpmDevicePcrItem, 1); + FuTpmDevicePcrItem *item; g_return_if_fail(FU_IS_TPM_DEVICE(self)); g_return_if_fail(checksum != NULL); + item = g_new0(FuTpmDevicePcrItem, 1); item->idx = idx; item->checksum = g_strdup(checksum); g_debug("added PCR-%02u=%s", item->idx, item->checksum); -- 2.39.5