We call free(obj.data) unconditionally on errors, but is is not set to NULL.
Also, return always success in add_one_audio_file() in order to continue the
loop.
const struct private_add_data *pad = private_data;
struct audio_format_info afhi, *afhi_ptr = NULL;
struct osl_row *pb = NULL, *hs = NULL; /* path brother/hash sister */
const struct private_add_data *pad = private_data;
struct audio_format_info afhi, *afhi_ptr = NULL;
struct osl_row *pb = NULL, *hs = NULL; /* path brother/hash sister */
- struct osl_object map, obj, query, result;
+ struct osl_object map, obj = {.data = NULL}, query, result;
char *path;
HASH_TYPE hash[HASH_SIZE];
char *path;
HASH_TYPE hash[HASH_SIZE];
free(path);
if (afhi_ptr)
free(afhi_ptr->chunk_table);
free(path);
if (afhi_ptr)
free(afhi_ptr->chunk_table);
+ return 1; /* it's not an error if not all files could be added */
}
int com_add(int fd, int argc, char * const * const argv)
}
int com_add(int fd, int argc, char * const * const argv)
ret = afl[i].get_file_info(data, size, afhi);
if (ret >= 0)
return i;
ret = afl[i].get_file_info(data, size, afhi);
if (ret >= 0)
return i;
+ PARA_WARNING_LOG("%s\n", PARA_STRERROR(-ret));
}
return -E_AUDIO_FORMAT;
}
}
return -E_AUDIO_FORMAT;
}