summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@gmail.com>2011-03-22 15:20:47 +0100
committerChristophe Fergeau <teuf@gnome.org>2011-03-22 15:34:09 +0100
commitb5e17b77046c1998776646e602c7be2e84b21191 (patch)
tree5ddd6b9cadaf55af0726f96531bc765b4458f716
parent1ccc821f23cb78e247d06557693277fd4cb225f3 (diff)
gtk/display: be more paranoid about potentially NULL pointerHEADmaster
If things don't go as expected in gnome_rr_config_ensure_primary (for example we don't find any usable output), we may end up trying to dereference a NULL pointer. It's better to check top_left is not NULL before using it.
-rw-r--r--gtk/display/gnome-rr-config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/display/gnome-rr-config.c b/gtk/display/gnome-rr-config.c
index 5e22596..bb5cafc 100644
--- a/gtk/display/gnome-rr-config.c
+++ b/gtk/display/gnome-rr-config.c
@@ -1230,7 +1230,7 @@ gnome_rr_config_ensure_primary (GnomeRRConfig *configuration)
if (!found) {
if (laptop != NULL) {
laptop->priv->primary = TRUE;
- } else {
+ } else if (top_left != NULL) {
top_left->priv->primary = TRUE;
}
}