Code

store: Don't destroy an attribute if data_copy() failed.
authorSebastian Harl <sh@tokkee.org>
Thu, 3 Jul 2014 16:37:17 +0000 (18:37 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 3 Jul 2014 16:37:17 +0000 (18:37 +0200)
Else, the store would reference invalid memory.

src/core/store.c

index 866661a59ee963758db185ab5f3db8b2d7a54710..3885e5064f22931ba4791642108b4eda26aebe85 100644 (file)
@@ -534,7 +534,6 @@ sdb_store_attribute(const char *hostname,
                assert(updated_attr);
                sdb_data_free_datum(&ATTR(updated_attr)->value);
                if (sdb_data_copy(&ATTR(updated_attr)->value, value)) {
-                       sdb_object_deref(SDB_OBJ(updated_attr));
                        status = -1;
                }
        }