libdrm: check for allocation failure

main
Maarten Maathuis 2008-06-23 21:15:54 +02:00
parent 0a45f15066
commit f9dad8cc22
1 changed files with 3 additions and 0 deletions

View File

@ -419,6 +419,9 @@ drmModeConnectorPtr drmModeGetConnector(int fd, uint32_t connector_id)
r->connector_type = conn.connector_type;
r->connector_type_id = conn.connector_type_id;
if (!r->props || !r->prop_values || !r->modes || !r->encoders)
goto err_allocs;
err_allocs:
drmFree(U642VOID(conn.prop_values_ptr));
drmFree(U642VOID(conn.props_ptr));