summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2012-03-15 21:07:26 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-04-05 11:20:08 -0700
commitcf667071bab4673468b10c837a024aae30f3f9af (patch)
tree3d1f87e91ff377f4fafff78e78e9092e7d91a7f4
parent1f9961c46d1d507046e57bb08e0d2e25d77f2d82 (diff)
downloadding-libs-cf667071bab4673468b10c837a024aae30f3f9af.tar.gz
ding-libs-cf667071bab4673468b10c837a024aae30f3f9af.tar.xz
ding-libs-cf667071bab4673468b10c837a024aae30f3f9af.zip
Fixing coverity issues 10078 & 10079
The fact that the other_test could return EOK on error was the actual problem.
-rw-r--r--ini/ini_valueobj_ut.c10
1 files 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) {