summaryrefslogtreecommitdiffstats
path: root/ospfclient/ospf_apiclient.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-10-14 18:30:01 +0200
committerMark Stapp <mjs@voltanet.io>2020-10-14 19:41:00 +0200
commitd81937481ddcbccb501626fd26306b3c6a476922 (patch)
tree224a3a4dc1ec6f4f5791a51d9cfb1e712efb3cc2 /ospfclient/ospf_apiclient.c
parentMerge pull request #7180 from kuldeepkash/bgp-communities (diff)
downloadfrr-d81937481ddcbccb501626fd26306b3c6a476922.tar.xz
frr-d81937481ddcbccb501626fd26306b3c6a476922.zip
ospfd: fix SA warnings in ospfd, ospfclient
Fix some SA warnings in ospf GR and ospfclient code. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'ospfclient/ospf_apiclient.c')
-rw-r--r--ospfclient/ospf_apiclient.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/ospfclient/ospf_apiclient.c b/ospfclient/ospf_apiclient.c
index fb8ad3e60..d4f0dc953 100644
--- a/ospfclient/ospf_apiclient.c
+++ b/ospfclient/ospf_apiclient.c
@@ -565,6 +565,7 @@ static void ospf_apiclient_handle_lsa_update(struct ospf_apiclient *oclient,
{
struct msg_lsa_change_notify *cn;
struct lsa_header *lsa;
+ void *p;
uint16_t lsalen;
cn = (struct msg_lsa_change_notify *)STREAM_DATA(msg->s);
@@ -578,9 +579,11 @@ static void ospf_apiclient_handle_lsa_update(struct ospf_apiclient *oclient,
__func__, lsalen, OSPF_MAX_LSA_SIZE);
return;
}
- lsa = XMALLOC(MTYPE_OSPF_APICLIENT, lsalen);
- memcpy(lsa, &(cn->data), lsalen);
+ p = XMALLOC(MTYPE_OSPF_APICLIENT, lsalen);
+
+ memcpy(p, &(cn->data), lsalen);
+ lsa = p;
/* Invoke registered update callback function */
if (oclient->update_notify) {
@@ -589,7 +592,7 @@ static void ospf_apiclient_handle_lsa_update(struct ospf_apiclient *oclient,
}
/* free memory allocated by ospf apiclient library */
- XFREE(MTYPE_OSPF_APICLIENT, lsa);
+ XFREE(MTYPE_OSPF_APICLIENT, p);
}
static void ospf_apiclient_handle_lsa_delete(struct ospf_apiclient *oclient,
@@ -597,6 +600,7 @@ static void ospf_apiclient_handle_lsa_delete(struct ospf_apiclient *oclient,
{
struct msg_lsa_change_notify *cn;
struct lsa_header *lsa;
+ void *p;
uint16_t lsalen;
cn = (struct msg_lsa_change_notify *)STREAM_DATA(msg->s);
@@ -610,9 +614,11 @@ static void ospf_apiclient_handle_lsa_delete(struct ospf_apiclient *oclient,
__func__, lsalen, OSPF_MAX_LSA_SIZE);
return;
}
- lsa = XMALLOC(MTYPE_OSPF_APICLIENT, lsalen);
- memcpy(lsa, &(cn->data), lsalen);
+ p = XMALLOC(MTYPE_OSPF_APICLIENT, lsalen);
+
+ memcpy(p, &(cn->data), lsalen);
+ lsa = p;
/* Invoke registered update callback function */
if (oclient->delete_notify) {
@@ -621,7 +627,7 @@ static void ospf_apiclient_handle_lsa_delete(struct ospf_apiclient *oclient,
}
/* free memory allocated by ospf apiclient library */
- XFREE(MTYPE_OSPF_APICLIENT, lsa);
+ XFREE(MTYPE_OSPF_APICLIENT, p);
}
static void ospf_apiclient_msghandle(struct ospf_apiclient *oclient,