Source-Changes-HG archive

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

[src/trunk]: src/common/lib/libprop Fix a paste-o that caused prop_data_creat...



details:   https://anonhg.NetBSD.org/src/rev/7efd03096794
branches:  trunk
changeset: 934256:7efd03096794
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jun 08 21:31:56 2020 +0000

description:
Fix a paste-o that caused prop_data_create_copy() to be intolerant
of creating empty data objects.  Fixes t_ifconfig::ifconfig_description
unit test.

diffstat:

 common/lib/libprop/prop_data.c |  5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diffs (19 lines):

diff -r cd539bc14f0c -r 7efd03096794 common/lib/libprop/prop_data.c
--- a/common/lib/libprop/prop_data.c    Mon Jun 08 21:31:17 2020 +0000
+++ b/common/lib/libprop/prop_data.c    Mon Jun 08 21:31:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: prop_data.c,v 1.16 2020/06/06 21:25:59 thorpej Exp $   */
+/*     $NetBSD: prop_data.c,v 1.17 2020/06/08 21:31:56 thorpej Exp $   */
 
 /*-
  * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc.
@@ -273,9 +273,6 @@
        prop_data_t pd;
        void *nv;
 
-       if (v == NULL || size == 0)
-               return (NULL);
-
        /* Tolerate the creation of empty data objects. */
        if (v != NULL && size != 0) {
                nv = _PROP_MALLOC(size, M_PROP_DATA);



Home | Main Index | Thread Index | Old Index