summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/stockticker/libstocks/stocks.c
authorerik <erik>2007-01-24 19:46:19 (UTC)
committer erik <erik>2007-01-24 19:46:19 (UTC)
commita017bf21dd89159052f2f7a3fbc043a24956c08c (patch) (side-by-side diff)
tree008be2b62ee5487dc55b8a7c7f043c94268f8362 /noncore/todayplugins/stockticker/libstocks/stocks.c
parenta4a7bd22feb060a80e20c81cded43cc24f5cd423 (diff)
downloadopie-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.c23
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
@@ -239,3 +239,2 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
case YAHOO_US:
-
if (us_quotes)
@@ -248,4 +247,4 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
{
- fprintf(stderr,"Memory allocating error (%s line %d)\n"
- ,__FILE__, __LINE__);
+ fprintf(stderr,"Memory allocating error (%s line %d)\n",
+ __FILE__, __LINE__);
exit(1);
@@ -265,4 +264,4 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
{
- fprintf(stderr,"Memory allocating error (%s line %d)\n"
- ,__FILE__, __LINE__);
+ fprintf(stderr,"Memory allocating error (%s line %d)\n",
+ __FILE__, __LINE__);
exit(1);
@@ -275,3 +274,2 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
case YAHOO_EUROPE:
-
if (eu_quotes)
@@ -284,4 +282,4 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
{
- fprintf(stderr,"Memory allocating error (%s line %d)\n"
- ,__FILE__, __LINE__);
+ fprintf(stderr,"Memory allocating error (%s line %d)\n",
+ __FILE__, __LINE__);
exit(1);
@@ -300,4 +298,4 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
{
- fprintf(stderr,"Memory allocating error (%s line %d)\n"
- ,__FILE__, __LINE__);
+ fprintf(stderr,"Memory allocating error (%s line %d)\n",
+ __FILE__, __LINE__);
exit(1);
@@ -316,2 +314,3 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
error = download_stocks(us_quotes, &stocks_tmp, YAHOO_US);
+ free(us_quotes);
if (error) return error;
@@ -323,2 +322,3 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
error = download_stocks(eu_quotes, &stocks_getted, YAHOO_EUROPE);
+ free(eu_quotes);
if (error) return error;
@@ -340,3 +340,4 @@ libstocks_return_code get_stocks(const char *stocks, stock **stock_datas)
}
- else (stocks_tmp = stocks_getted);
+ else
+ (stocks_tmp = stocks_getted);
}