[PATCH] libnm: Warning if private data is NULL

Check the priv pointer before loop traverse.
Warning this instead of leaving the program crash directly.
 libnm/nm-manager.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c
index a6c1f3f..7d86a51 100644
--- a/libnm/nm-manager.c
+++ b/libnm/nm-manager.c
@@ -816,6 +816,11 @@ recheck_pending_activations (NMManager *self)
        const GPtrArray *devices;
        NMDevice *device;
+       if (!priv) {
+               g_warning ("%s: private data should not be NULL", __func__);
+               return;
+       }
        /* For each pending activation, look for an active connection that has the
         * pending activation's object path, where the active connection and its
         * device have both updated their properties to point to each other, and

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]