From 1a016f1915c27d641e800d29ab22067766cb9412 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Mon, 19 Sep 2011 12:47:02 +0000 Subject: [PATCH] eio: don't free internal data. SVN revision: 63479 --- legacy/eio/src/lib/eio_private.h | 2 ++ legacy/eio/src/lib/eio_xattr.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/legacy/eio/src/lib/eio_private.h b/legacy/eio/src/lib/eio_private.h index a501801b65..13bb825f3d 100644 --- a/legacy/eio/src/lib/eio_private.h +++ b/legacy/eio/src/lib/eio_private.h @@ -199,6 +199,8 @@ struct _Eio_File_Xattr int xattr_int; } xint; } todo; + + Eina_Bool set : 1; }; struct _Eio_File_Progress diff --git a/legacy/eio/src/lib/eio_xattr.c b/legacy/eio/src/lib/eio_xattr.c index 38d235fc02..bcbc6fd4c2 100644 --- a/legacy/eio/src/lib/eio_xattr.c +++ b/legacy/eio/src/lib/eio_xattr.c @@ -112,8 +112,11 @@ _eio_file_xattr_free(Eio_File_Xattr *async) { eina_stringshare_del(async->path); eina_stringshare_del(async->attribute); - if (async->op == EIO_XATTR_DATA) free(async->todo.xdata.xattr_data); - if (async->op == EIO_XATTR_STRING) free(async->todo.xstring.xattr_string); + if (!async->set) + { + if (async->op == EIO_XATTR_DATA) free(async->todo.xdata.xattr_data); + if (async->op == EIO_XATTR_STRING) free(async->todo.xstring.xattr_string); + } free(async); } @@ -215,6 +218,7 @@ _eio_file_xattr_setup_get(Eio_File_Xattr *async, { async->path = eina_stringshare_add(path); async->attribute = eina_stringshare_add(attribute); + async->set = EINA_FALSE; if (!eio_file_set(&async->common, NULL, @@ -240,6 +244,7 @@ _eio_file_xattr_setup_set(Eio_File_Xattr *async, async->path = eina_stringshare_add(path); async->attribute = eina_stringshare_add(attribute); async->flags = flags; + async->set = EINA_TRUE; if (!eio_file_set(&async->common, done_cb,