Blame SOURCES/coverity2.patch
|
|
11423e |
diff --up ./src/compare_db.c ./src/compare_db.c
|
|
|
11423e |
--- ./src/compare_db.c
|
|
|
11423e |
+++ ./src/compare_db.c
|
|
|
11423e |
@@ -438,7 +438,11 @@ snprintf(*values[0], l, "%s",s);
|
|
|
11423e |
} else {
|
|
|
11423e |
*values = malloc(1 * sizeof (char*));
|
|
|
11423e |
if (DB_FTYPE&attr) {
|
|
|
11423e |
- easy_string(get_file_type_string(line->perm))
|
|
|
11423e |
+ char *file_type = get_file_type_string(line->perm);
|
|
|
11423e |
+ if (!file_type) {
|
|
|
11423e |
+ error(2,"%s: ", file_type);
|
|
|
11423e |
+ }
|
|
|
11423e |
+ easy_string(file_type)
|
|
|
11423e |
} else if (DB_LINKNAME&attr) {
|
|
|
11423e |
easy_string(line->linkname)
|
|
|
11423e |
easy_number((DB_SIZE|DB_SIZEG),size,"%li")
|
|
|
11423e |
diff -up ./src/db_file.c ./src/db_file.c
|
|
|
11423e |
--- ./src/db_file.c
|
|
|
11423e |
+++ ./src/db_file.c
|
|
|
11423e |
@@ -194,6 +194,10 @@ int db_file_read_spec(int db){
|
|
|
11423e |
|
|
|
11423e |
*db_order=(DB_FIELD*) malloc(1*sizeof(DB_FIELD));
|
|
|
11423e |
|
|
|
11423e |
+ if (*db_order == NULL){
|
|
|
11423e |
+ error(1,"malloc for *db_order failed in %s", __func__);
|
|
|
11423e |
+ }
|
|
|
11423e |
+
|
|
|
11423e |
while ((i=db_scan())!=TNEWLINE){
|
|
|
11423e |
switch (i) {
|
|
|
11423e |
|
|
|
11423e |
|