author | erik <erik> | 2007-01-24 19:46:19 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-24 19:46:19 (UTC) |
commit | a017bf21dd89159052f2f7a3fbc043a24956c08c (patch) (side-by-side diff) | |
tree | 008be2b62ee5487dc55b8a7c7f043c94268f8362 /noncore/todayplugins/stockticker/libstocks/stocks.c | |
parent | a4a7bd22feb060a80e20c81cded43cc24f5cd423 (diff) | |
download | opie-a017bf21dd89159052f2f7a3fbc043a24956c08c.zip opie-a017bf21dd89159052f2f7a3fbc043a24956c08c.tar.gz opie-a017bf21dd89159052f2f7a3fbc043a24956c08c.tar.bz2 |
Every file in this commit has a memory leak of some kind or another. I think
all of them are minor and should not effect properly running code. But if I
were you I would give libstocks and the stockticker plugin in Today a wide
berth. That library is atrocious.
Diffstat (limited to 'noncore/todayplugins/stockticker/libstocks/stocks.c') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/todayplugins/stockticker/libstocks/stocks.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/noncore/todayplugins/stockticker/libstocks/stocks.c b/noncore/todayplugins/stockticker/libstocks/stocks.c index eb04ba9..3a26a47 100644 --- a/noncore/todayplugins/stockticker/libstocks/stocks.c +++ b/noncore/todayplugins/stockticker/libstocks/stocks.c @@ -238,5 +238,4 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) { case YAHOO_US: - if (us_quotes) { @@ -247,6 +246,6 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) if(us_quotes_temp==NULL) { - fprintf(stderr,"Memory allocating error (%s line %d)\n" - ,__FILE__, __LINE__); + fprintf(stderr,"Memory allocating error (%s line %d)\n", + __FILE__, __LINE__); exit(1); } @@ -264,6 +263,6 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) if(us_quotes==NULL) { - fprintf(stderr,"Memory allocating error (%s line %d)\n" - ,__FILE__, __LINE__); + fprintf(stderr,"Memory allocating error (%s line %d)\n", + __FILE__, __LINE__); exit(1); } @@ -274,5 +273,4 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) case YAHOO_EUROPE: - if (eu_quotes) { @@ -283,6 +281,6 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) if(eu_quotes_temp==NULL) { - fprintf(stderr,"Memory allocating error (%s line %d)\n" - ,__FILE__, __LINE__); + fprintf(stderr,"Memory allocating error (%s line %d)\n", + __FILE__, __LINE__); exit(1); } @@ -299,6 +297,6 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) if(eu_quotes==NULL) { - fprintf(stderr,"Memory allocating error (%s line %d)\n" - ,__FILE__, __LINE__); + fprintf(stderr,"Memory allocating error (%s line %d)\n", + __FILE__, __LINE__); exit(1); } @@ -315,4 +313,5 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) /* Gets us quotes */ error = download_stocks(us_quotes, &stocks_tmp, YAHOO_US); + free(us_quotes); if (error) return error; } @@ -322,4 +321,5 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) /* Gets european quotes */ error = download_stocks(eu_quotes, &stocks_getted, YAHOO_EUROPE); + free(eu_quotes); if (error) return error; @@ -339,5 +339,6 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas) } - else (stocks_tmp = stocks_getted); + else + (stocks_tmp = stocks_getted); } |