From cf667071bab4673468b10c837a024aae30f3f9af Mon Sep 17 00:00:00 2001 From: Dmitri Pal Date: Thu, 15 Mar 2012 21:07:26 -0400 Subject: Fixing coverity issues 10078 & 10079 The fact that the other_test could return EOK on error was the actual problem. --- ini/ini_valueobj_ut.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ini/ini_valueobj_ut.c b/ini/ini_valueobj_ut.c index 767a64c..cb261fe 100644 --- a/ini/ini_valueobj_ut.c +++ b/ini/ini_valueobj_ut.c @@ -233,7 +233,7 @@ int other_create_test(FILE *ff, struct value_obj **vo) if (strncmp(fullstr, expected, strlen(expected) + 1) != 0) { printf("The expected value is different.\n%s\n", fullstr); value_destroy(new_vo); - return error; + return EINVAL; } /* Get value's origin */ @@ -247,7 +247,7 @@ int other_create_test(FILE *ff, struct value_obj **vo) if (origin != INI_VALUE_READ) { printf("The expected origin is different.\n%d\n", origin); value_destroy(new_vo); - return error; + return EINVAL; } /* Get value's line */ @@ -261,7 +261,7 @@ int other_create_test(FILE *ff, struct value_obj **vo) if (line != 1) { printf("The expected line is different.\n%d\n", origin); value_destroy(new_vo); - return error; + return EINVAL; } /* Get comment from the value */ @@ -300,7 +300,7 @@ int other_create_test(FILE *ff, struct value_obj **vo) /* But this should not happen anyways - * it will be coding error. */ - return error; + return EINVAL; } /* Put comment back */ @@ -428,6 +428,8 @@ int vo_basic_test(void) value_destroy(vo); } + vo = NULL; + /* Run other create test here */ error = other_create_test(ff, &vo); if (error) { -- cgit