From: Glen Choo Date: Fri, 02 Jun 2023 17:26:34 GMT Subject: Re: [PATCH v2 09/14] config.c: provide kvi with CLI config Message-ID: In-Reply-To: <20230601233550.429921-1-jonathantanmy@google.com> Jonathan Tan writes: >> + memcpy(&matched->kvi, kvi, sizeof(struct key_value_info)); > > Can this just be > > matched->kvi = *kvi; > > ? If I remember correctly (big if), we have to copy the memory because the config machinery allocates kvi on the stack, and the relevant functions have returned by then. Hm, does this suggest that kvi should be const? > If not, for the sizeof, use *kvi as the argument instead of struct > key_value_info. Makes sense.