X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/7be8c02360bdb9bd7f59b087da874f88af2a7206..c45798dbfce66810be2cea8d0051f429f342e90b:/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;