Module Name: src Committed By: christos Date: Mon Feb 15 15:37:20 UTC 2016
Modified Files: src/lib/libedit: tokenizer.c Log Message: OpenBSD tokenizer.c rev. 1.8 2003/08/11 18:21:40 deraadt don't increase amax on realloc failure To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/lib/libedit/tokenizer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libedit/tokenizer.c diff -u src/lib/libedit/tokenizer.c:1.22 src/lib/libedit/tokenizer.c:1.23 --- src/lib/libedit/tokenizer.c:1.22 Fri Jan 29 23:02:51 2016 +++ src/lib/libedit/tokenizer.c Mon Feb 15 10:37:20 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $ */ +/* $NetBSD: tokenizer.c,v 1.23 2016/02/15 15:37:20 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tokenizer.c,v 1.22 2016/01/30 04:02:51 christos Exp $"); +__RCSID("$NetBSD: tokenizer.c,v 1.23 2016/02/15 15:37:20 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -413,8 +413,10 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, cons Char **p; tok->amax += AINCR; p = tok_realloc(tok->argv, tok->amax * sizeof(*p)); - if (p == NULL) + if (p == NULL) { + tok->amax -= AINCR; return -1; + } tok->argv = p; } }