Message ID | 1367912809-22456-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 05/07/2013 03:46 PM, Colin King wrote: > From: Colin Ian King <colin.king@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@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; > } > } > Acked-by: Alex Hung <alex.hung@canonical.com>
On Tue, May 7, 2013 at 3:46 PM, Colin King <colin.king@canonical.com> wrote: > From: Colin Ian King <colin.king@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@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 > Acked-by: Keng-Yu Lin <kengyu@canonical.com>
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; } }