From abeb4c92ee1d3a64dfe17821866dceb332d15b62 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 20 Apr 2010 14:15:30 +0000 Subject: [PATCH] corrected mismatched free/delete in avatar items. Might have caused random crashes. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2740 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/serialiser/rsmsgitems.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/serialiser/rsmsgitems.cc b/libretroshare/src/serialiser/rsmsgitems.cc index d85e9f7dc..fc48785b8 100644 --- a/libretroshare/src/serialiser/rsmsgitems.cc +++ b/libretroshare/src/serialiser/rsmsgitems.cc @@ -149,8 +149,11 @@ uint32_t RsChatAvatarItem::serial_size() RsChatAvatarItem::~RsChatAvatarItem() { - free(image_data) ; - image_data = NULL ; + if(image_data != NULL) + { + delete[] image_data ; + image_data = NULL ; + } } /* serialise the data to the buffer */