diff options
author | Gary Kramlich <grim@reaperworld.com> | 2021-06-01 20:15:16 -0500 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2021-06-01 20:15:16 -0500 |
commit | 1058dda69c8b07c883adf11d4f944f9b41fbf87e (patch) | |
tree | adae3dca4b27e8906645d0d5d81b4d984ee3cef5 | |
parent | 7808c144e04f63fc24bb8a5f9bef6c6dd55fd80a (diff) | |
download | pidgin-1058dda69c8b07c883adf11d4f944f9b41fbf87e.tar.gz |
Fix some issues scanbuild found in prefs.c
Testing Done:
Verified scanbuild no longer detected the errors.
Reviewed at https://reviews.imfreedom.org/r/700/
-rw-r--r-- | libpurple/prefs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libpurple/prefs.c b/libpurple/prefs.c index b8fa51779f..d3cb30d216 100644 --- a/libpurple/prefs.c +++ b/libpurple/prefs.c @@ -756,14 +756,17 @@ purple_prefs_add_path_list(const char *name, GList *value) static void remove_pref(struct purple_pref *pref) { + struct purple_pref *child = NULL, *next = NULL; char *name; GSList *l; if(!pref) return; - while(pref->first_child) - remove_pref(pref->first_child); + for(child = pref->first_child; child != NULL; child = next) { + next = child->sibling; + remove_pref(child); + } if(pref == &prefs) return; @@ -1581,7 +1584,6 @@ disco_ui_callback_helper_handle(void *handle) GSList *cbs; PurplePrefsUiOps *uiop = purple_prefs_get_ui_ops(); - cbs = ui_callbacks; for (cbs = ui_callbacks; cbs; cbs = cbs->next) { PurplePrefCallbackData *cb = cbs->data; if (cb->handle != handle) { |