From: Marek Schimara Date: Fri, 17 Jun 2016 11:27:07 +0000 (+0200) Subject: src/rrd_fetch_libdbi.c: fix Coverity CID#13630 Unchecked return value X-Git-Tag: v1.7.0~42^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca354a1ad6d722acec222c6a286bd6113a0fcb2a;p=thirdparty%2Frrdtool-1.x.git src/rrd_fetch_libdbi.c: fix Coverity CID#13630 Unchecked return value CWE-252 / https://cwe.mitre.org/data/definitions/252.html --- diff --git a/src/rrd_fetch_libdbi.c b/src/rrd_fetch_libdbi.c index 8a868efc..895abec9 100644 --- a/src/rrd_fetch_libdbi.c +++ b/src/rrd_fetch_libdbi.c @@ -250,7 +250,10 @@ static int _sql_fetchrow(struct sql_table_helper* th,time_t *timestamp, rrd_valu /* calculate the table to use next */ th->table_start=th->table_next; th->table_next=_find_next_separator(th->table_start,'+'); - _inline_unescape(th->table_start); + if (_inline_unescape(th->table_start)) { + _sql_close(th); + return -1; + } /* and prepare FULL SQL Statement */ if (ordered) { snprintf(sql,sizeof(sql)-1,"SELECT %s as rrd_time, %s as rrd_value FROM %s WHERE %s ORDER BY %s",