[PATCH] lib: fwts_framework: free just items in list and not list descriptor

Colin King colin.king at canonical.com
Tue May 7 07:46:49 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

Coverity CID #997320: Free of address-of expression

We should be just free'ing the items in the list and not the
list descriptor because that is not on the heap.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_framework.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
index 67dd3ab..857b54e 100644
--- a/src/lib/src/fwts_framework.c
+++ b/src/lib/src/fwts_framework.c
@@ -925,7 +925,7 @@ static int fwts_framework_filter_error_parse(const char *arg, fwts_list *list)
 	for (str = (char*)arg; (token = strtok_r(str, ",", &saveptr)) != NULL; str = NULL) {
 		if (fwts_list_append(list, token) == NULL) {
 			fprintf(stderr, "Out of memory parsing argument %s\n", arg);
-			fwts_list_free(list, NULL);
+			fwts_list_free_items(list, NULL);
 			return FWTS_ERROR;
 		}
 	}
-- 
1.8.1.2




More information about the fwts-devel mailing list