aboutsummaryrefslogtreecommitdiff
path: root/libcacard/cac.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-05-23 13:24:37 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2014-05-24 00:46:20 +0400
commit26b78f4d3c3f45f84067440e56c3ebf2d25a9574 (patch)
tree18b701bec9b4e8849079f9dac7dc9881e935d098 /libcacard/cac.c
parentf33a984d512dbcb6762b002a65de4ea748e31d4a (diff)
libcacard: Convert two leftover realloc() to GLib
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'libcacard/cac.c')
-rw-r--r--libcacard/cac.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/libcacard/cac.c b/libcacard/cac.c
index 122129ec14..3887896c58 100644
--- a/libcacard/cac.c
+++ b/libcacard/cac.c
@@ -169,17 +169,8 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
}
size = apdu->a_Lc;
- sign_buffer = realloc(pki_applet->sign_buffer,
- pki_applet->sign_buffer_len+size);
- if (sign_buffer == NULL) {
- g_free(pki_applet->sign_buffer);
- pki_applet->sign_buffer = NULL;
- pki_applet->sign_buffer_len = 0;
- *response = vcard_make_response(
- VCARD7816_STATUS_EXC_ERROR_MEMORY_FAILURE);
- ret = VCARD_DONE;
- break;
- }
+ sign_buffer = g_realloc(pki_applet->sign_buffer,
+ pki_applet->sign_buffer_len + size);
memcpy(sign_buffer+pki_applet->sign_buffer_len, apdu->a_body, size);
size += pki_applet->sign_buffer_len;
switch (apdu->a_p1) {