aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-04-24 17:52:55 -0300
committerdequis <dx@dxzone.com.ar>2015-04-24 17:52:55 -0300
commit1493c4b7eff51e231c65f7728c0cf84ca45cf837 (patch)
tree163e1fbfb01c06b09136e105d7dc850e5e883c98 /lib
parent71074ac7e43cfaf9b479e14de70b7d2bb48af806 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/oauth.c5
1 files changed, 3 insertions, 2 deletions
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] == '=') {