mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
libcacard: Drop superfluous conditionals around g_free()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
6b1dd54b6a
commit
ec15993d9d
5 changed files with 12 additions and 32 deletions
|
@ -172,16 +172,12 @@ vcard_response_delete(VCardResponse *response)
|
|||
switch (response->b_type) {
|
||||
case VCARD_MALLOC:
|
||||
/* everything was malloc'ed */
|
||||
if (response->b_data) {
|
||||
g_free(response->b_data);
|
||||
}
|
||||
g_free(response->b_data);
|
||||
g_free(response);
|
||||
break;
|
||||
case VCARD_MALLOC_DATA:
|
||||
/* only the data buffer was malloc'ed */
|
||||
if (response->b_data) {
|
||||
g_free(response->b_data);
|
||||
}
|
||||
g_free(response->b_data);
|
||||
break;
|
||||
case VCARD_MALLOC_STRUCT:
|
||||
/* only the structure was malloc'ed */
|
||||
|
@ -358,9 +354,7 @@ vcard_apdu_delete(VCardAPDU *apdu)
|
|||
if (apdu == NULL) {
|
||||
return;
|
||||
}
|
||||
if (apdu->a_data) {
|
||||
g_free(apdu->a_data);
|
||||
}
|
||||
g_free(apdu->a_data);
|
||||
g_free(apdu);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue