From 41108b9ed9f32ca9ad1b3d4a48a91a6f22c65db6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 22 Nov 2021 18:11:27 +0100 Subject: [PATCH] nsswitch: move winbindd_free_response() as inline function to winbind_struct_protocol.h nsswitch/wb_common.c will be made completely internal soon. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider --- nsswitch/wb_common.c | 10 ---------- nsswitch/winbind_client.h | 1 - nsswitch/winbind_struct_protocol.h | 10 ++++++++++ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/nsswitch/wb_common.c b/nsswitch/wb_common.c index 45c1969acc2..1a3ed1241c5 100644 --- a/nsswitch/wb_common.c +++ b/nsswitch/wb_common.c @@ -67,16 +67,6 @@ static void put_wb_global_ctx(void) return; } -/* Free a response structure */ - -void winbindd_free_response(struct winbindd_response *response) -{ - /* Free any allocated extra_data */ - - if (response) - SAFE_FREE(response->extra_data.data); -} - void winbind_set_client_name(const char *name) { if (name == NULL || strlen(name) == 0) { diff --git a/nsswitch/winbind_client.h b/nsswitch/winbind_client.h index c0ee6c9391a..93b5672ba04 100644 --- a/nsswitch/winbind_client.h +++ b/nsswitch/winbind_client.h @@ -34,7 +34,6 @@ struct winbindd_context; struct winbindd_context *winbindd_ctx_create(void); void winbindd_ctx_free(struct winbindd_context *ctx); -void winbindd_free_response(struct winbindd_response *response); NSS_STATUS winbindd_request_response(struct winbindd_context *ctx, int req_type, struct winbindd_request *request, diff --git a/nsswitch/winbind_struct_protocol.h b/nsswitch/winbind_struct_protocol.h index 4a5255c7fe4..87d10ae6e3e 100644 --- a/nsswitch/winbind_struct_protocol.h +++ b/nsswitch/winbind_struct_protocol.h @@ -522,4 +522,14 @@ struct winbindd_response { } extra_data; }; +/* Free a response structure */ + +static inline void winbindd_free_response(struct winbindd_response *response) +{ + /* Free any allocated extra_data */ + + if (response) + SAFE_FREE(response->extra_data.data); +} + #endif