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 */