Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src do not malloc(0). Andrew Lunn



details:   https://anonhg.NetBSD.org/src/rev/5a424b5d8b77
branches:  trunk
changeset: 555605:5a424b5d8b77
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Nov 23 08:23:02 2003 +0000

description:
do not malloc(0).  Andrew Lunn

diffstat:

 crypto/dist/kame/libipsec/policy_parse.y |  2 +-
 lib/libipsec/policy_parse.y              |  4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 1febc7f0fb68 -r 5a424b5d8b77 crypto/dist/kame/libipsec/policy_parse.y
--- a/crypto/dist/kame/libipsec/policy_parse.y  Sun Nov 23 07:25:11 2003 +0000
+++ b/crypto/dist/kame/libipsec/policy_parse.y  Sun Nov 23 08:23:02 2003 +0000
@@ -293,7 +293,7 @@
 {
        struct sadb_x_policy *p;
 
-       pbuf = malloc(tlen);
+       pbuf = malloc(sizeof(struct sadb_x_policy));
        if (pbuf == NULL) {
                __ipsec_errcode = EIPSEC_NO_BUFS;
                return -1;
diff -r 1febc7f0fb68 -r 5a424b5d8b77 lib/libipsec/policy_parse.y
--- a/lib/libipsec/policy_parse.y       Sun Nov 23 07:25:11 2003 +0000
+++ b/lib/libipsec/policy_parse.y       Sun Nov 23 08:23:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: policy_parse.y,v 1.12 2003/10/03 21:53:08 itojun Exp $ */
+/*     $NetBSD: policy_parse.y,v 1.13 2003/11/23 08:23:02 itojun Exp $ */
 /*     $KAME: policy_parse.y,v 1.15 2003/10/02 19:37:49 itojun Exp $   */
 
 /*
@@ -294,7 +294,7 @@
 {
        struct sadb_x_policy *p;
 
-       pbuf = malloc(tlen);
+       pbuf = malloc(sizeof(struct sadb_x_policy));
        if (pbuf == NULL) {
                __ipsec_errcode = EIPSEC_NO_BUFS;
                return -1;



Home | Main Index | Thread Index | Old Index