pidgin/pidgin
Clone
Summary
Browse
Changes
Graph
Avoid g_object_ref of NULL
19 months ago, Elliott Sales de Andrade
57dcc21a926e
Parents
ff7a6c6f01f7
Children
74985c7b824d
Avoid g_object_ref of NULL
It is `NULL`-safe, but only with a `g_return_val_if_fail`, so it'll warn when passed `NULL`.
Testing Done:
Compile only
Reviewed at https://reviews.imfreedom.org/r/1836/
1 files changed, 3 insertions(+), 2 deletions(-)
+3
-2
libpurple/purpleprotocolmanager.c
--- a/libpurple/purpleprotocolmanager.c Mon Sep 26 03:41:21 2022 -0500
+++ b/libpurple/purpleprotocolmanager.c Mon Sep 26 04:29:19 2022 -0500
@@ -58,9 +58,10 @@
PurpleProtocol *protocol = NULL;
if(position < manager->list->len) {
- protocol = g_ptr_array_index(manager->list, position);
+ protocol = g_object_ref(g_ptr_array_index(manager->list, position));
}
- return g_object_ref(protocol);
+
+ return protocol;
}
static void