From 7f5f9dc1d02d71af5d553e8d56897eb80cc50dde Mon Sep 17 00:00:00 2001 From: rwatson Date: Thu, 14 Dec 2000 01:51:39 +0000 Subject: [PATCH] o Check return of strdup() for NULL, abort if so. Submitted by: jedgar --- usr.sbin/extattrctl/extattrctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/extattrctl/extattrctl.c b/usr.sbin/extattrctl/extattrctl.c index 78026878fecf..c05ec956b9e2 100644 --- a/usr.sbin/extattrctl/extattrctl.c +++ b/usr.sbin/extattrctl/extattrctl.c @@ -91,7 +91,10 @@ initattr(int argc, char *argv[]) overwrite = 1; break; case 'p': - fs_path = strdup(optarg); + if ((fs_path = strdup(optarg)) == NULL) { + perror("strdup"); + return(-1); + } break; case '?': default: