{
pkg_t *pkg;
- pkg = calloc(1, sizeof(pkg_t));
+ pkg = xcalloc(1, sizeof(pkg_t));
if (pkg == NULL) {
fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
return NULL;
{
abstract_pkg_t * ab_pkg;
- ab_pkg = calloc(1, sizeof(abstract_pkg_t));
+ ab_pkg = xcalloc(1, sizeof(abstract_pkg_t));
if (ab_pkg == NULL) {
fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
}
pkg->installed_files = str_list_alloc();
- if (pkg->installed_files == NULL) {
- fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
- return NULL;
- }
/* For uninstalled packages, get the file list directly from the package.
For installed packages, look at the package.list file in the database.
len += strlen(pkg_state_flag_map[i].str) + 1;
}
}
- str = malloc(len);
- if ( str == NULL ) {
- fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
- return NULL;
- }
+ str = xmalloc(len);
str[0] = 0;
for (i=0; i < ARRAY_SIZE(pkg_state_flag_map); i++) {
if (sf & pkg_state_flag_map[i].value) {