=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/top.c,v retrieving revision 1.73 retrieving revision 1.74 diff -c -r1.73 -r1.74 *** src/usr.bin/top/top.c 2010/03/26 16:56:00 1.73 --- src/usr.bin/top/top.c 2010/04/21 11:29:59 1.74 *************** *** 1,4 **** ! /* $OpenBSD: top.c,v 1.73 2010/03/26 16:56:00 lum Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: top.c,v 1.74 2010/04/21 11:29:59 lum Exp $ */ /* * Top users/processes display for Unix *************** *** 231,237 **** break; case 'g': /* grep command name */ ! ps.command = strdup(optarg); break; default: --- 231,239 ---- break; case 'g': /* grep command name */ ! free(ps.command); ! if((ps.command = strdup(optarg)) == NULL); ! err(1, NULL); break; default: *************** *** 861,867 **** tempbuf[1] == '\0') ps.command = NULL; else ! ps.command = strdup(tempbuf); putr(); } else clear_message(); --- 863,871 ---- tempbuf[1] == '\0') ps.command = NULL; else ! if((ps.command = strdup(tempbuf)) == ! NULL); ! err(1, NULL); putr(); } else clear_message();