From: Fabian Keil Date: Sun, 30 Oct 2011 16:16:07 +0000 (+0000) Subject: Remove a superfluos temporary variable in get_last_url() X-Git-Tag: v_3_0_18~65 X-Git-Url: http://www.privoxy.org/gitweb/%22/%40user-manual%40%40helplink%40DOWNGRADE-HTTP-VERSION?a=commitdiff_plain;h=5d9cfc05611df825ca8e09bd578506ef62f17cd9;p=privoxy.git Remove a superfluos temporary variable in get_last_url() 'subject' is already strdup()'d so there's no need to make another temporary copy for strtok(). --- diff --git a/filters.c b/filters.c index cfdde10d..c4bfd9a7 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.146 2011/10/30 16:15:29 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.147 2011/10/30 16:15:43 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -1117,8 +1117,7 @@ char *get_last_url(char *subject, const char *redirect_mode) * Keep the last one we spot. */ char *found = NULL; - char *s = strdup(subject); - char *token = strtok(s, "?&"); + char *token = strtok(subject, "?&"); while (token) { char *dtoken = url_decode(token); @@ -1135,7 +1134,6 @@ char *get_last_url(char *subject, const char *redirect_mode) } token = strtok(NULL, "?&"); } - freez(s); if (found) {