From 995c3b2c67a7c4fe7a5424df7c3d48dc11e7c708 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Fri, 3 Mar 2023 17:41:02 +0100 Subject: [PATCH] typo in rearrange includes; unused reason parameter in snmp_lib --- apps/backend/Makefile.in | 2 +- apps/snmp/snmp_lib.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/backend/Makefile.in b/apps/backend/Makefile.in index c5c2f409..0b48743e 100644 --- a/apps/backend/Makefile.in +++ b/apps/backend/Makefile.in @@ -158,7 +158,7 @@ uninstall: rm -f $(DESTDIR)$(libdir)/$(MYLIBDYNAMIC) rm -f $(DESTDIR)$(includedir)/clixon/* -install-include: clixon_backend.h clixon_backend_handle.h clixon_backend_transaction.h clixon_backend_plugin.h clixon_backend_commit.h +install-include: clixon_backend.h clixon_backend_client.h clixon_backend_transaction.h clixon_backend_plugin.h clixon_backend_commit.h install -d -m 0755 $(DESTDIR)$(includedir)/clixon install -m 0644 $^ $(DESTDIR)$(includedir)/clixon diff --git a/apps/snmp/snmp_lib.c b/apps/snmp/snmp_lib.c index 9887f3c7..b3f57b12 100644 --- a/apps/snmp/snmp_lib.c +++ b/apps/snmp/snmp_lib.c @@ -725,6 +725,7 @@ type_xml2snmp_pre(char *xmlstr0, char *restype = NULL; /* resolved type */ char *str = NULL; int ret; + cbuf *cb = NULL; if (xmlstr0 == NULL || xmlstr1 == NULL){ clicon_err(OE_UNIX, EINVAL, "xmlstr0/1 is NULL"); @@ -753,11 +754,14 @@ type_xml2snmp_pre(char *xmlstr0, str = "1"; } else if( strcmp(restype, "decimal64") == 0 ) { - char **reason; - cbuf *cb = cbuf_new(); cg_var* cv = yang_cv_get(ys); int64_t num; - if( (ret = parse_dec64(xmlstr0, cv_dec64_n_get(cv), &num, reason)) < 0) + + if ((cb = cbuf_new()) == NULL){ + clicon_err(OE_UNIX, errno, "cbuf_new"); + goto done; + } + if ((ret = parse_dec64(xmlstr0, cv_dec64_n_get(cv), &num, NULL)) < 0) goto done; if (ret == 0){ clicon_debug(1, "Invalid decimal64 valstr %s", xmlstr0); @@ -777,6 +781,8 @@ type_xml2snmp_pre(char *xmlstr0, retval = 1; done: clicon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval); + if (cb) + cbuf_free(cb); return retval; fail: retval = 0;