]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/contrib/netrc.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 12 May 2011 23:12:21 +0000 (01:12 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 12 May 2011 23:12:21 +0000 (01:12 +0200)
  - replace non-posix gnu-extension strdupa with strdup

apt-pkg/contrib/netrc.cc
debian/changelog

index d8027fc24c6605f54ac745fbe0b88f1c242feb66..34f472ee1b619c1bc85e860c1d1148126c492f45 100644 (file)
@@ -160,10 +160,10 @@ void maybe_add_auth (URI &Uri, string NetRCFile)
     {
       char login[64] = "";
       char password[64] = "";
-      char *netrcfile = strdupa (NetRCFile.c_str ());
+      char *netrcfile = strdup(NetRCFile.c_str());
 
       // first check for a generic host based netrc entry
-      char *host = strdupa (Uri.Host.c_str ());
+      char *host = strdup(Uri.Host.c_str());
       if (host && parsenetrc (host, login, password, netrcfile) == 0)
       {
         if (_config->FindB("Debug::Acquire::netrc", false) == true)
@@ -173,13 +173,16 @@ void maybe_add_auth (URI &Uri, string NetRCFile)
                      << std::endl;
         Uri.User = string (login);
         Uri.Password = string (password);
+       free(netrcfile);
+       free(host);
        return;
       }
+      free(host);
 
       // if host did not work, try Host+Path next, this will trigger
       // a lookup uri.startswith(host) in the netrc file parser (because
       // of the "/"
-      char *hostpath = strdupa (string(Uri.Host+Uri.Path).c_str ());
+      char *hostpath = strdup(string(Uri.Host+Uri.Path).c_str());
       if (hostpath && parsenetrc (hostpath, login, password, netrcfile) == 0)
       {
         if (_config->FindB("Debug::Acquire::netrc", false) == true)
@@ -189,8 +192,9 @@ void maybe_add_auth (URI &Uri, string NetRCFile)
                      << std::endl;
         Uri.User = string (login);
         Uri.Password = string (password);
-        return;
       }
+      free(netrcfile);
+      free(hostpath);
     }
   }
 }
index 2c578d25874809e1daee6183cdf80d4603487133..edcd2b8518b4b92d479a40a8eee52838f9ef5b95 100644 (file)
@@ -54,8 +54,10 @@ apt (0.8.14.2) UNRELEASED; urgency=low
       servers just send an absolute path so still deal with it properly
     - dequote URL taken from Location in redirects as we will otherwise
       quote an already quoted string in the request later (Closes: #602412)
+  * apt-pkg/contrib/netrc.cc:
+    - replace non-posix gnu-extension strdupa with strdup
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 11 May 2011 13:58:40 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 13 May 2011 01:08:04 +0200
 
 apt (0.8.14.1) unstable; urgency=low