diff options
| author | Franklin Wei <git@fwei.tk> | 2015-05-17 17:23:18 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2015-05-17 17:23:18 -0400 |
| commit | 8e9a52ceae1f2e0fac76d06ff5e6a2170dcdd1bb (patch) | |
| tree | 11868a8886f35f802c14f091d28b69c4d9abedc4 /src/sell.c | |
| parent | c13b48095f91b6c277854b9970c59c82943af74f (diff) | |
| download | market-sim-8e9a52ceae1f2e0fac76d06ff5e6a2170dcdd1bb.zip market-sim-8e9a52ceae1f2e0fac76d06ff5e6a2170dcdd1bb.tar.gz market-sim-8e9a52ceae1f2e0fac76d06ff5e6a2170dcdd1bb.tar.bz2 market-sim-8e9a52ceae1f2e0fac76d06ff5e6a2170dcdd1bb.tar.xz | |
fix some memory leaks
Diffstat (limited to 'src/sell.c')
| -rw-r--r-- | src/sell.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -14,14 +14,17 @@ void sell_handler(struct player_t *player) if(!stock) { printf("Couldn't find '%s' in portfolio.\n", sym); + free(sym); return; } + free(sym); + printf("Updating prices...\n"); get_stock_info(stock->symbol, &stock->current_price, &stock->fullname); - printf("You currently own %llu shares of '%s' (%s) valued at $%llu.%02llu each.\n", + printf("You currently own %llu share(s) of '%s' (%s) valued at $%llu.%02llu each.\n", stock->count, stock->fullname, stock->symbol, stock->current_price.cents / 100, stock->current_price.cents % 100); printf("How many shares do you wish to sell? "); |