=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/Attic/proto.c,v retrieving revision 1.26 retrieving revision 1.27 diff -c -r1.26 -r1.27 *** src/usr.bin/cvs/Attic/proto.c 2004/11/15 04:16:33 1.26 --- src/usr.bin/cvs/Attic/proto.c 2004/11/16 21:03:43 1.27 *************** *** 1,4 **** ! /* $OpenBSD: proto.c,v 1.26 2004/11/15 04:16:33 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: proto.c,v 1.27 2004/11/16 21:03:43 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 440,448 **** len = cvs_buf_size(buf); vrstr = (char *)malloc(len); cvs_buf_copy(buf, 0, vrstr, len); - cvs_buf_free(buf); return (vrstr); --- 440,451 ---- 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,527 **** --- 525,534 ---- 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);