From 1493c4b7eff51e231c65f7728c0cf84ca45cf837 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 24 Apr 2015 17:52:55 -0300 Subject: oauth: fix use-after-free of the ->next of the list Third time's the charm. Previous attempt fixed something and broke something else. Whatever. Definitely valgrind clean this time. --- lib/oauth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/oauth.c b/lib/oauth.c index 005d76c4..71a7f862 100644 --- a/lib/oauth.c +++ b/lib/oauth.c @@ -95,13 +95,14 @@ void oauth_params_add(GSList **params, const char *key, const char *value) void oauth_params_del(GSList **params, const char *key) { int key_len = strlen(key); - GSList *l; + GSList *l, *n; if (!params) { return; } - for (l = *params; l; l = l->next) { + for (l = *params; l; l = n) { + n = l->next; char *data = l->data; if (strncmp(data, key, key_len) == 0 && data[key_len] == '=') { -- cgit v1.2.3