[openssh-commits] [openssh] 01/01: Remove dependency on xmalloc.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Feb 26 04:15:02 AEDT 2015


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 678e473e2af2e4802f24dd913985864d9ead7fb3
Author: Darren Tucker <dtucker at zip.com.au>
Date:   Thu Feb 26 04:12:58 2015 +1100

    Remove dependency on xmalloc.
    
    Remove ssh_get_progname's dependency on xmalloc, which should reduce
    link order problems.  ok djm@
---
 openbsd-compat/bsd-misc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 65e8003..f7be415 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -31,8 +31,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "xmalloc.h"
-
 #ifndef HAVE___PROGNAME
 char *__progname;
 #endif
@@ -43,13 +41,12 @@ char *__progname;
  */
 char *ssh_get_progname(char *argv0)
 {
+	char *p, *q;
 #ifdef HAVE___PROGNAME
 	extern char *__progname;
 
-	return xstrdup(__progname);
+	p = __progname;
 #else
-	char *p;
-
 	if (argv0 == NULL)
 		return ("unknown");	/* XXX */
 	p = strrchr(argv0, '/');
@@ -57,9 +54,12 @@ char *ssh_get_progname(char *argv0)
 		p = argv0;
 	else
 		p++;
-
-	return (xstrdup(p));
 #endif
+	if ((q = strdup(p)) == NULL) {
+		perror("strdup");
+		exit(1);
+	}
+	return q;
 }
 
 #ifndef HAVE_SETLOGIN

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list