X-Git-Url: https://git.wpitchoune.net/gitweb/?p=prss.git;a=blobdiff_plain;f=src%2Fttrss.c;h=6e32cc0fc01efff387efc02df16c64c30a626fb5;hp=4ac5fdf2d4a2ad820d8ea40715dd3ab0a00c3518;hb=ba998dd7b5a61fc2a1fa25538dc370eff0368c2c;hpb=31f62874654f7fd89e362616db13008f7bfc236a diff --git a/src/ttrss.c b/src/ttrss.c index 4ac5fdf..6e32cc0 100644 --- a/src/ttrss.c +++ b/src/ttrss.c @@ -60,7 +60,7 @@ static void file_set_content(const char *path, const char *content) } } -const char *ttrss_get_headline_content(struct headline *h) +char *ttrss_get_headline_content(struct headline *h) { const char *cache_dir; char *path, *content; @@ -71,11 +71,11 @@ const char *ttrss_get_headline_content(struct headline *h) content = file_get_content(path); - if (content) - file_set_content(path, content); - else + if (!content) { content = ws_get_article_content(h->id); - + file_set_content(path, content); + } + g_free(path); return content;