xvfb: protect from memory allocation failure
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
f0257bfe93
commit
b32cd8c759
|
@ -484,6 +484,8 @@ vfbInstallColormap(ColormapPtr pmap)
|
|||
ppix = calloc(entries, sizeof(Pixel));
|
||||
prgb = calloc(entries, sizeof(xrgb));
|
||||
defs = calloc(entries, sizeof(xColorItem));
|
||||
if (!ppix || !prgb || !defs)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < entries; i++)
|
||||
ppix[i] = i;
|
||||
|
@ -499,6 +501,7 @@ vfbInstallColormap(ColormapPtr pmap)
|
|||
}
|
||||
(*pmap->pScreen->StoreColors) (pmap, entries, defs);
|
||||
|
||||
out:
|
||||
free(ppix);
|
||||
free(prgb);
|
||||
free(defs);
|
||||
|
|
Loading…
Reference in New Issue