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); } |