X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/afd7b358f94efddb83a2911ec1a21e7280074b1e..4e1c86a6c0cf9a6e51ec4f9b9ad9271547fa036d:/apt-pkg/contrib/netrc.cc diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index b9d0749e2..56e59d84b 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -14,7 +14,9 @@ #include #include +#include #include + #include #include #include @@ -24,6 +26,7 @@ #include "netrc.h" +using std::string; /* Get user and password from .netrc when given a machine name */ @@ -65,8 +68,7 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL) if (!home) return -1; - asprintf (&netrcfile, "%s%s%s", home, DIR_CHAR, NETRC); - if(!netrcfile) + if (asprintf (&netrcfile, "%s%s%s", home, DIR_CHAR, NETRC) == -1 || netrcfile == NULL) return -1; else netrc_alloc = true;