From ec15993d9d7ea7108101f068c9929a62be29dc67 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 6 Jun 2014 18:32:08 +0200 Subject: libcacard: Drop superfluous conditionals around g_free() Signed-off-by: Markus Armbruster Signed-off-by: Michael Tokarev --- libcacard/cac.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libcacard/cac.c') diff --git a/libcacard/cac.c b/libcacard/cac.c index 0a0163d3eb..ae8c3784b9 100644 --- a/libcacard/cac.c +++ b/libcacard/cac.c @@ -100,10 +100,8 @@ cac_applet_pki_reset(VCard *card, int channel) pki_applet = &(applet_private->u.pki_data); pki_applet->cert_buffer = NULL; - if (pki_applet->sign_buffer) { - g_free(pki_applet->sign_buffer); - pki_applet->sign_buffer = NULL; - } + g_free(pki_applet->sign_buffer); + pki_applet->sign_buffer = NULL; pki_applet->cert_buffer_len = 0; pki_applet->sign_buffer_len = 0; return VCARD_DONE; @@ -285,12 +283,8 @@ cac_delete_pki_applet_private(VCardAppletPrivate *applet_private) return; } pki_applet_data = &(applet_private->u.pki_data); - if (pki_applet_data->cert != NULL) { - g_free(pki_applet_data->cert); - } - if (pki_applet_data->sign_buffer != NULL) { - g_free(pki_applet_data->sign_buffer); - } + g_free(pki_applet_data->cert); + g_free(pki_applet_data->sign_buffer); if (pki_applet_data->key != NULL) { vcard_emul_delete_key(pki_applet_data->key); } -- cgit v1.2.3