From cc7f7cc534b1b60bad49e99411749cb680aaaf8d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 4 Jan 2015 00:34:26 +0000 Subject: [PATCH] osl_update_object(): Honor OSL_DONT_FREE. When osl_update_object() is called to replace an object of an OSL_NO_STORAGE column, it frees the old object even if the OSL_DONT_FREE flag is set for the column, which is wrong. This patch changes the function to call free() only if OSL_DONT_FREE is unset. --- osl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osl.c b/osl.c index c6959ac..80bec0f 100644 --- a/osl.c +++ b/osl.c @@ -1572,7 +1572,8 @@ __export int osl_update_object(struct osl_table *t, const struct osl_row *r, } remove_rb_node(t, col_num, r); if (cd->storage_type == OSL_NO_STORAGE) { /* TODO: If fixed size, reuse object? */ - free(r->volatile_objects[col->volatile_num].data); + if (!(cd->storage_flags & OSL_DONT_FREE)) + free(r->volatile_objects[col->volatile_num].data); r->volatile_objects[col->volatile_num] = *obj; } else if (cd->storage_type == OSL_DISK_STORAGE) { char *ds_name; -- 2.39.5