From 0f43024f70553c7955f65b9d1cad95a5b3372e45 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sat, 16 Aug 2014 19:32:48 +0200 Subject: [PATCH] idnode: fix the short uuid check in idnode_insert() --- src/idnode.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/idnode.c b/src/idnode.c index 7a4e7d28..3decceab 100644 --- a/src/idnode.c +++ b/src/idnode.c @@ -108,7 +108,7 @@ idnode_done(void) int idnode_insert(idnode_t *in, const char *uuid, const idclass_t *class, int flags) { - idnode_t *c, skel; + idnode_t *c; lock_assert(&global_lock); tvh_uuid_t u; int retries = 5; @@ -121,11 +121,8 @@ idnode_insert(idnode_t *in, const char *uuid, const idclass_t *class, int flags) memcpy(in->in_uuid, u.bin, sizeof(in->in_uuid)); c = NULL; - if (flags & IDNODE_SHORT_UUID) { - if(hex2bin(skel.in_uuid, sizeof(skel.in_uuid), uuid)) - return -1; - c = RB_FIND(&idnodes, &skel, in_link, in_cmp_short); - } + if (flags & IDNODE_SHORT_UUID) + c = RB_FIND(&idnodes, in, in_link, in_cmp_short); if (c == NULL) c = RB_INSERT_SORTED(&idnodes, in, in_link, in_cmp);