aboutsummaryrefslogtreecommitdiff
path: root/src/info.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2015-05-17 17:29:14 -0400
committerFranklin Wei <git@fwei.tk>2015-05-17 17:29:14 -0400
commitd18dba4781fe5044e567fd3c85b43ea9a8b001b0 (patch)
tree8a454c5c31cfc72d17e6ccda5137582b1bae3e82 /src/info.c
parent8e9a52ceae1f2e0fac76d06ff5e6a2170dcdd1bb (diff)
downloadmarket-sim-d18dba4781fe5044e567fd3c85b43ea9a8b001b0.zip
market-sim-d18dba4781fe5044e567fd3c85b43ea9a8b001b0.tar.gz
market-sim-d18dba4781fe5044e567fd3c85b43ea9a8b001b0.tar.bz2
market-sim-d18dba4781fe5044e567fd3c85b43ea9a8b001b0.tar.xz
fix some memory leaks
Diffstat (limited to 'src/info.c')
-rw-r--r--src/info.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/info.c b/src/info.c
index 0fa66fe..3f79736 100644
--- a/src/info.c
+++ b/src/info.c
@@ -8,14 +8,15 @@ void info_handler(struct player_t *player)
struct stock_t *stock = find_stock(player, sym);
- free(sym);
-
if(!stock)
{
printf("Couldn't find '%s' in portfolio.\n", sym);
+ free(sym);
return;
}
+ free(sym);
+
printf("Transaction history:\n");
print_history(stock);
}