aboutsummaryrefslogtreecommitdiff
path: root/libcacard/vreader.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-22 11:08:04 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-01-30 11:14:46 +0100
commitbe168af860109a1ecc8526c5bbe0ace1536448b8 (patch)
treeacb0700408c43b8205cff101ded58b1aa5ba62b3 /libcacard/vreader.c
parent40a50b0a73d185c85cf62023f07e3091861081bb (diff)
libcacard: Fix unchecked strdup() by converting to g_strdup()
Note that we already free with g_free(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'libcacard/vreader.c')
-rw-r--r--libcacard/vreader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcacard/vreader.c b/libcacard/vreader.c
index 313349b656..f3efc270a2 100644
--- a/libcacard/vreader.c
+++ b/libcacard/vreader.c
@@ -49,7 +49,7 @@ vreader_new(const char *name, VReaderEmul *private,
reader = (VReader *)g_malloc(sizeof(VReader));
qemu_mutex_init(&reader->lock);
reader->reference_count = 1;
- reader->name = name ? strdup(name) : NULL;
+ reader->name = g_strdup(name);
reader->card = NULL;
reader->id = (vreader_id_t)-1;
reader->reader_private = private;