Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions ppd/ppd-collection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,14 @@ ppdCollectionListPPDs(
cupsArrayAdd(result, strdup(ppd->record.make));
else
{
newppd = (ppd_info_t *)malloc(sizeof(ppd_info_t));
if ((newppd = (ppd_info_t *)malloc(sizeof(ppd_info_t))) == NULL)
{
if (log) log(ld, CF_LOGLEVEL_ERROR,
"libppd: [PPD Collections] Ran out of memory copying "
"PPD %s!",
ppd->record.name);
break;
}
memcpy(newppd, ppd, sizeof(ppd_info_t));
cupsArrayAdd(result, newppd);
}
Expand Down Expand Up @@ -2089,7 +2096,14 @@ load_ppds(const char *d, // I - Actual directory
// Nope, add it to the Inodes array and continue...
//

dinfoptr = (struct stat *)malloc(sizeof(struct stat));
if ((dinfoptr = (struct stat *)malloc(sizeof(struct stat))) == NULL)
{
if (log) log(ld, CF_LOGLEVEL_ERROR,
"libppd: [PPD Collections] Ran out of memory recording "
"\"%s\" for loop detection!",
d);
return (0);
}
memcpy(dinfoptr, &dinfo, sizeof(struct stat));
cupsArrayAdd(ppdlist->Inodes, dinfoptr);

Expand Down
Loading