From: Alan T. DeKok Date: Tue, 6 Apr 2021 12:35:02 +0000 (-0400) Subject: declare 'key' as const, which avoids a weird memcpy X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef6f959783799f8712d8935f295dfbb943061883;p=thirdparty%2Ffreeradius-server.git declare 'key' as const, which avoids a weird memcpy --- diff --git a/src/main/listen.c b/src/main/listen.c index 7aa539d1ef..e14d86608d 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -3714,7 +3714,7 @@ rad_listen_t *listener_find_byipaddr(fr_ipaddr_t const *ipaddr, uint16_t port, i static rbtree_t *coa_tree = NULL; typedef struct { - char *key; + char const *key; rad_listen_t *first; pthread_mutex_t mutex; /* per key, to lower contention */ @@ -3780,7 +3780,7 @@ void listen_coa_add(rad_listen_t *this, char const *key) /* * Find the key. If we can't find it, then create it. */ - memcpy(&my_key.key, &key, sizeof(key)); /* const issues */ + my_key.key = key; retry: coa_key = rbtree_finddata(coa_tree, &my_key);