1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

1 Commits

Author SHA1 Message Date
0c3f38b81b linux: freebsd: do check on proper pointer
We want to check here if we added something to the list, not if the
function argument was valid. Problem spotted by Coverity, CID 50754.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-02-28 18:01:25 +01:00
3 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "libserialport"
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # control system is used.
PROJECT_NUMBER = "0.1.1" PROJECT_NUMBER = "unreleased development snapshot"
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a

View File

@ -373,7 +373,7 @@ SP_PRIV enum sp_return list_ports(struct sp_port ***list)
DBG("%s: %s\n", __func__, entry.d_name); DBG("%s: %s\n", __func__, entry.d_name);
*list = list_append(*list, name); *list = list_append(*list, name);
if (!list) { if (!*list) {
SET_ERROR(ret, SP_ERR_MEM, "List append failed"); SET_ERROR(ret, SP_ERR_MEM, "List append failed");
break; break;
} }

View File

@ -236,7 +236,7 @@ SP_PRIV enum sp_return list_ports(struct sp_port ***list)
} }
DEBUG_FMT("Found port %s", name); DEBUG_FMT("Found port %s", name);
*list = list_append(*list, name); *list = list_append(*list, name);
if (!list) { if (!*list) {
SET_ERROR(ret, SP_ERR_MEM, "List append failed"); SET_ERROR(ret, SP_ERR_MEM, "List append failed");
break; break;
} }