summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-03-20 17:05:11 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-03-20 17:05:11 +0100
commit31bda5000136d77f516cf2080257835fb44deaef (patch)
treeb4c430aee7efcc71382ab73954612f6ff7fe3ef4 /apt-pkg/contrib
parent05343a22b8c7d9b491e93169e035a996ff68af9f (diff)
* apt-pkg/acquire-worker.cc:
- check return of write() as gcc recommends * apt-pkg/acquire.cc: - check return of write() as gcc recommends * apt-pkg/cdrom.cc: - check return of chdir() and link() as gcc recommends * apt-pkg/clean.cc: - check return of chdir() as gcc recommends * apt-pkg/contrib/netrc.cc: - check return of asprintf() as gcc recommends
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/netrc.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc
index cb7d36088..56e59d84b 100644
--- a/apt-pkg/contrib/netrc.cc
+++ b/apt-pkg/contrib/netrc.cc
@@ -68,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;