diff options
Diffstat (limited to 'src/XrrProviderProperty.c')
-rw-r--r-- | src/XrrProviderProperty.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/XrrProviderProperty.c b/src/XrrProviderProperty.c index 6989580..34cc082 100644 --- a/src/XrrProviderProperty.c +++ b/src/XrrProviderProperty.c @@ -259,6 +259,13 @@ XRRGetProviderProperty (Display *dpy, RRProvider provider, xRRGetProviderPropertyReq *req; unsigned long nbytes, rbytes; + /* Always initialize return values, in case callers fail to initialize + them and fail to check the return code for an error. */ + *actual_type = None; + *actual_format = 0; + *nitems = *bytes_after = 0L; + *prop = (unsigned char *) NULL; + RRCheckExtension (dpy, info, 1); LockDisplay (dpy); @@ -280,7 +287,6 @@ XRRGetProviderProperty (Display *dpy, RRProvider provider, return ((xError *)&rep)->errorCode; } - *prop = (unsigned char *) NULL; if (rep.propertyType != None) { int format = rep.format; |