glx: NULL check the correct argument in dispatch_GLXVendorPriv
malloc can return NULL, unlike GetVendorDispatchFunc. The latter provides DispatchBadRequest. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
1310241e8d
commit
7fc7579869
@ -387,12 +387,13 @@ static int dispatch_GLXVendorPriv(ClientPtr client)
|
|||||||
// we'll still add an entry to the dispatch table, so that we don't
|
// we'll still add an entry to the dispatch table, so that we don't
|
||||||
// have to look it up again later.
|
// have to look it up again later.
|
||||||
disp = (GlxVendorPrivDispatch *) malloc(sizeof(GlxVendorPrivDispatch));
|
disp = (GlxVendorPrivDispatch *) malloc(sizeof(GlxVendorPrivDispatch));
|
||||||
|
if (disp == NULL) {
|
||||||
|
return BadAlloc;
|
||||||
|
}
|
||||||
|
|
||||||
disp->proc = GetVendorDispatchFunc(stuff->glxCode,
|
disp->proc = GetVendorDispatchFunc(stuff->glxCode,
|
||||||
GlxCheckSwap(client,
|
GlxCheckSwap(client,
|
||||||
stuff->vendorCode));
|
stuff->vendorCode));
|
||||||
if (disp->proc == NULL) {
|
|
||||||
disp->proc = DispatchBadRequest;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return disp->proc(client);
|
return disp->proc(client);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user