diff options
author | Dmitri Pal <dpal@redhat.com> | 2012-03-15 21:07:26 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-04-05 11:20:08 -0700 |
commit | cf667071bab4673468b10c837a024aae30f3f9af (patch) | |
tree | 3d1f87e91ff377f4fafff78e78e9092e7d91a7f4 /ini | |
parent | 1f9961c46d1d507046e57bb08e0d2e25d77f2d82 (diff) | |
download | ding-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.
Diffstat (limited to 'ini')
-rw-r--r-- | ini/ini_valueobj_ut.c | 10 |
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) { |