diff options
author | 2004-11-16 21:03:43 +0000 | |
---|---|---|
committer | 2004-11-16 21:03:43 +0000 | |
commit | 0b99f494012571aeb0e077846ca527c0adf668d7 (patch) | |
tree | 6a0b276be12d9fdb81a64c6b2119576a72bb0be4 | |
parent | Strip kernels compiled with DEBUG=-g leaving an unstripped kernel as bsd.gdb. (diff) | |
download | wireguard-openbsd-0b99f494012571aeb0e077846ca527c0adf668d7.tar.xz wireguard-openbsd-0b99f494012571aeb0e077846ca527c0adf668d7.zip |
more correct error checking, from Joris Vink <amni at pandora dot be>
-rw-r--r-- | usr.bin/cvs/proto.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index 1acfb788f42..3ebbde34314 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.26 2004/11/15 04:16:33 jfb Exp $ */ +/* $OpenBSD: proto.c,v 1.27 2004/11/16 21:03:43 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -440,9 +440,12 @@ cvs_req_getvalid(void) len = cvs_buf_size(buf); vrstr = (char *)malloc(len); + if (vrstr == NULL) { + cvs_buf_free(buf); + return (NULL); + } cvs_buf_copy(buf, 0, vrstr, len); - cvs_buf_free(buf); return (vrstr); @@ -522,6 +525,10 @@ cvs_resp_getvalid(void) len = cvs_buf_size(buf); vrstr = (char *)malloc(len); + if (vrstr == NULL) { + cvs_buf_free(buf); + return (NULL); + } cvs_buf_copy(buf, 0, vrstr, len); cvs_buf_free(buf); |