X-Git-Url: https://git.wpitchoune.net/gitweb/?p=prss.git;a=blobdiff_plain;f=src%2Fttrss_ws.c;fp=src%2Fttrss_ws.c;h=0aed58d9d4b62984383697e103730c6c300b619c;hp=4b9c040932f5d7b710f34f6da0d11dd477989648;hb=c6e1efc5d14895adeddd08dca19a954efa6fabdc;hpb=3ef3a6b2acadc5546328a4d96e584dc4f7215af5 diff --git a/src/ttrss_ws.c b/src/ttrss_ws.c index 4b9c040..0aed58d 100644 --- a/src/ttrss_ws.c +++ b/src/ttrss_ws.c @@ -245,7 +245,6 @@ int ws_open_session() session_id = NULL; result = 0; } - result = 1; } else { result = 0; } @@ -331,6 +330,12 @@ int ws_update_headlines(struct feed *feed) j = json_object_object_get(jheadline, "unread"); h->unread = json_object_get_boolean(j); } + + if (!feed->headlines) { + feed->headlines = malloc(sizeof(struct headline *)); + *(feed->headlines) = NULL; + } + json_object_put(rp); return 1; } else {