Fix createitem to not leak memory

develop
Quietust 2013-03-14 12:00:16 -05:00
parent e7c102646c
commit 2b675c80ce
1 changed files with 3 additions and 1 deletions

@ -248,7 +248,9 @@ command_result df_createitem (color_ostream &out, vector <string> & parameters)
break; break;
} }
if (!makeItem(prod, unit)) bool result = makeItem(prod, unit);
delete prod;
if (!result)
{ {
out.printerr("Failed to create item!\n"); out.printerr("Failed to create item!\n");
return CR_FAILURE; return CR_FAILURE;