From 92403205019d91ea10ec7caafb5bb41c08c3f9dc Mon Sep 17 00:00:00 2001 From: Lemongrass3110 Date: Tue, 14 Jan 2014 22:44:43 +0100 Subject: [PATCH] Possible leak fix --- src/map/vending.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/map/vending.c b/src/map/vending.c index 8aa1645f20..fbff410c80 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -470,6 +470,8 @@ void vending_reopen( struct map_session_data* sd ){ if( vending->count <= 0 ){ idb_remove( autotrade_db, sd->status.char_id ); + aFree(vending->entries); + aFree(vending); map_quit(sd); return; } @@ -498,6 +500,9 @@ void vending_reopen( struct map_session_data* sd ){ } if( !count ){ + idb_remove( autotrade_db, sd->status.char_id ); + aFree(vending->entries); + aFree(vending); map_quit(sd); return; } @@ -597,8 +602,9 @@ void do_init_vending_autotrade( void ){ if( vending->count <= 0 ){ // Player was not correctly deleted, must not be set online - vending->count = 0; + idb_remove( autotrade_db, vending->char_id ); map_quit(vending->sd); + aFree(vending); continue; }