summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be8fe81)
raw | patch | inline | side by side (parent: be8fe81)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 1 Dec 2013 15:55:13 +0000 (16:55 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 1 Dec 2013 15:55:13 +0000 (16:55 +0100) |
Else, failed init may leak memory.
src/core/object.c | patch | blob | history |
diff --git a/src/core/object.c b/src/core/object.c
index 0205ed588f1e58a8afd727a99443c8037add9604..43bb22a8fbf83ee39cb781beab8e34426f9505e9 100644 (file)
--- a/src/core/object.c
+++ b/src/core/object.c
if (! obj)
return NULL;
memset(obj, 0, type.size);
+ obj->type = type;
if (name) {
obj->name = strdup(name);
}
}
- obj->type = type;
obj->ref_cnt = 1;
return obj;
} /* sdb_object_vcreate */