diff options
| author | Franklin Wei <git@fwei.tk> | 2015-05-17 17:29:14 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2015-05-17 17:29:14 -0400 |
| commit | d18dba4781fe5044e567fd3c85b43ea9a8b001b0 (patch) | |
| tree | 8a454c5c31cfc72d17e6ccda5137582b1bae3e82 /src/info.c | |
| parent | 8e9a52ceae1f2e0fac76d06ff5e6a2170dcdd1bb (diff) | |
| download | market-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); } |