diff options
author | deraadt <deraadt@openbsd.org> | 2003-09-26 16:09:27 +0000 |
---|---|---|
committer | deraadt <deraadt@openbsd.org> | 2003-09-26 16:09:27 +0000 |
commit | ca198d9fd5536b16b1bee8213328f8a2f3931898 (patch) | |
tree | a00fe029b6d87fad5f04e78a6ce035dbe8d13c3f /usr.sbin/wsmoused | |
parent | can free(NULL) (diff) | |
download | wireguard-openbsd-ca198d9fd5536b16b1bee8213328f8a2f3931898.tar.xz wireguard-openbsd-ca198d9fd5536b16b1bee8213328f8a2f3931898.zip |
check strdup failure; ok anil millert
Diffstat (limited to 'usr.sbin/wsmoused')
-rw-r--r-- | usr.sbin/wsmoused/wsmoused.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/wsmoused/wsmoused.c b/usr.sbin/wsmoused/wsmoused.c index 453c6bc24c3..ae01a593765 100644 --- a/usr.sbin/wsmoused/wsmoused.c +++ b/usr.sbin/wsmoused/wsmoused.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmoused.c,v 1.14 2003/04/13 11:20:47 jmc Exp $ */ +/* $OpenBSD: wsmoused.c,v 1.15 2003/09/26 16:09:27 deraadt Exp $ */ /* * Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon @@ -521,7 +521,8 @@ main(int argc, char **argv) identify = TRUE; break; case 'p': - mouse.portname = strdup(optarg); + if ((mouse.portname = strdup(optarg)) == NULL) + logerr(1, "out of memory"); break; case 't': if (strcmp(optarg, "auto") == 0) { |