diff options
author | Jakub Jelen <jjelen@redhat.com> | 2019-07-04 14:59:24 +0200 |
---|---|---|
committer | Jakub Jelen <jjelen@redhat.com> | 2019-07-04 16:05:09 +0200 |
commit | 708fed0c074adafe78aca013c206ff66978d7c35 (patch) | |
tree | 3eb6a3a7d4dd8dc1541fd121cd52a559a76fbe51 /src | |
parent | 13bc693196e86b281d3c503b21f62d8dd338464a (diff) |
cac: Use g_memdup for better readability and avoiding code duplication
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/cac.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1972,8 +1972,7 @@ cac_new_empty_applet_private(unsigned char objects[][2], unsigned int objects_le /* Create Object ID list */ if (objects_len > 0) { - applet_private->coids = g_malloc_n(objects_len, sizeof(struct coid)); - memcpy(applet_private->coids, objects, 2*objects_len); + applet_private->coids = g_memdup(objects, sizeof(struct coid) * objects_len); applet_private->coids_len = objects_len; } |