diff options
| author | Franklin Wei <git@fwei.tk> | 2016-01-26 19:22:53 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-01-26 19:27:13 -0500 |
| commit | 3b8df7146fe31518080f3a38eee98222d97ee5b2 (patch) | |
| tree | 7fd7dffd98d0bfd3bdf20e24b184ec5440ca3909 /worlds | |
| parent | cbe6bc14de8ad8fd035e0598a3fcc23fb38cfa1a (diff) | |
| download | netcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.zip netcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.tar.gz netcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.tar.bz2 netcosm-3b8df7146fe31518080f3a38eee98222d97ee5b2.tar.xz | |
fix a memory leak, bumps version to 0.4.0-rc1
Diffstat (limited to 'worlds')
| -rw-r--r-- | worlds/test.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/worlds/test.c b/worlds/test.c index 2ce4122..722584c 100644 --- a/worlds/test.c +++ b/worlds/test.c @@ -115,13 +115,20 @@ void weap_destroy(struct object_t *obj) obj->userdata = NULL; } +void *weap_clone(void *userdata) +{ + void *ret = malloc(sizeof(double)); + memcpy(ret, userdata, sizeof(double)); + return ret; +} + const struct obj_class_t netcosm_obj_classes[] = { { "weapon", weap_serialize, weap_deserialize, NULL, NULL, - NULL, + weap_clone, weap_destroy, shiny }, }; |