aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-12-14 18:53:20 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-19 08:26:21 -0600
commitc5238ac21b82f92ab68ee4877a6a7cdfa0bb2605 (patch)
tree2c663023ef70967a73019d6aa66bacd510a4e981 /qdict.c
parentqdev: Improve uni-north device names (diff)
downloadqemu-kvm-c5238ac21b82f92ab68ee4877a6a7cdfa0bb2605.tar.gz
qemu-kvm-c5238ac21b82f92ab68ee4877a6a7cdfa0bb2605.tar.bz2
qemu-kvm-c5238ac21b82f92ab68ee4877a6a7cdfa0bb2605.zip
QDict: Fix size update
Key replacement should not update the dictionary's size. This commit also adds a test for the bug. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 29ec3156ee66b6e2553a0adb2f35cb143edddc5f)
Diffstat (limited to 'qdict.c')
-rw-r--r--qdict.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/qdict.c b/qdict.c
index ef73265f4..ba8eef09b 100644
--- a/qdict.c
+++ b/qdict.c
@@ -122,9 +122,8 @@ void qdict_put_obj(QDict *qdict, const char *key, QObject *value)
/* allocate a new entry */
entry = alloc_entry(key, value);
QLIST_INSERT_HEAD(&qdict->table[hash], entry, next);
+ qdict->size++;
}
-
- qdict->size++;
}
/**