Fixes the following warning:
pseudo_client.c: In function ‘pseudo_client_op’:
cc1: warning: function may return address of local variable
[-Wreturn-local-addr]
pseudo_client.c:1592:22: note: declared here
1592 | pseudo_msg_t msg = { .type = PSEUDO_MSG_OP };
| ^~~
Signed-off-by: Damian Wrobel <[email protected]>
---
pseudo_client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pseudo_client.c b/pseudo_client.c
index 2583bca..f1d09ff 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -1889,7 +1889,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int
dirfd, const char *path
case OP_CHROOT:
if (pseudo_client_chroot(path) == 0) {
/* return a non-zero value to show non-failure */
- result = &msg;
+ result = pseudo_msg_dup(&msg);
}
do_request = 0;
break;
--
2.31.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154159):
https://lists.openembedded.org/g/openembedded-core/message/154159
Mute This Topic: https://lists.openembedded.org/mt/84479678/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-