viewing paste Unknown #6444 | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -296,9 +296,13 @@
                        i++;
                }
        }
+       Sql_FreeResult(sql_handle);
       
-       if(!i) //No items found - No need to continue
+       if(!i) {//No items found - No need to continue
+               SqlStmt_Free(stmt);
+               StringBuf_Destroy(&buf);
                return 0;
+       }
 
        //First we delete the character's items
        StringBuf_Clear(&buf);
@@ -311,7 +315,6 @@
                StringBuf_Printf(&buf, " `id`=%d",items[j].id);
        }
 
-       stmt = SqlStmt_Malloc(sql_handle);
        if( SQL_ERROR == SqlStmt_PrepareStr(stmt, StringBuf_Value(&buf))
        ||  SQL_ERROR == SqlStmt_Execute(stmt) )
        {
@@ -342,7 +345,6 @@
                StringBuf_AppendStr(&buf, ")");
        }
 
-       stmt = SqlStmt_Malloc(sql_handle);
        if( SQL_ERROR == SqlStmt_PrepareStr(stmt, StringBuf_Value(&buf))
        ||  SQL_ERROR == SqlStmt_Execute(stmt) )
        {
@@ -352,6 +354,8 @@
                return 1;
        }
 
+       SqlStmt_Free(stmt);
+       StringBuf_Destroy(&buf);
        //Finally reload storage and tell map we're done
        mapif_load_guild_storage(fd,aid,guild_id,0);
        mapif_itembound_ack(fd,aid,guild_id);
 
Viewed 693 times, submitted by lighta.