mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-28 09:59:56 +00:00
(!1794) randr: RRCreateProviderProperty(): use calloc()
We can rely on everything being cleared. And usually even faster, as the compiler can emit optimized instructions for clearing a whole block at once. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -107,16 +107,10 @@ RRCreateProviderProperty(Atom property)
|
||||
{
|
||||
RRPropertyPtr prop;
|
||||
|
||||
prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec));
|
||||
prop = (RRPropertyPtr) calloc(1, sizeof(RRPropertyRec));
|
||||
if (!prop)
|
||||
return NULL;
|
||||
prop->next = NULL;
|
||||
prop->propertyName = property;
|
||||
prop->is_pending = FALSE;
|
||||
prop->range = FALSE;
|
||||
prop->immutable = FALSE;
|
||||
prop->num_valid = 0;
|
||||
prop->valid_values = NULL;
|
||||
RRInitProviderPropertyValue(&prop->current);
|
||||
RRInitProviderPropertyValue(&prop->pending);
|
||||
return prop;
|
||||
|
||||
Reference in New Issue
Block a user