[vlc-commits] No need to copy module in message item
Rémi Denis-Courmont
git at videolan.org
Wed May 11 18:54:34 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 11 18:23:32 2011 +0300| [f68b07bf9439482c4d1a3c57bff3aa7d81fd0cdc] | committer: Rémi Denis-Courmont
No need to copy module in message item
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f68b07bf9439482c4d1a3c57bff3aa7d81fd0cdc
---
include/vlc_messages.h | 4 ++--
src/misc/messages.c | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/vlc_messages.h b/include/vlc_messages.h
index 7221414..cfe5d94 100644
--- a/include/vlc_messages.h
+++ b/include/vlc_messages.h
@@ -50,7 +50,7 @@ typedef struct
int i_type; /**< message type, see below */
uintptr_t i_object_id;
const char *psz_object_type;
- char * psz_module;
+ const char *psz_module;
char * psz_msg; /**< the message itself */
char * psz_header; /**< Additional header */
} msg_item_t;
@@ -80,7 +80,7 @@ static inline msg_item_t *msg_Copy (const msg_item_t *msg)
static inline void msg_Free (msg_item_t *msg)
{
- free (msg->psz_module);
+ free ((char *)msg->psz_module);
free (msg->psz_msg);
free (msg->psz_header);
free (msg);
diff --git a/src/misc/messages.c b/src/misc/messages.c
index 64d7697..18943f1 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -370,7 +370,7 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
msg.i_type = i_type;
msg.i_object_id = (uintptr_t)p_this;
msg.psz_object_type = p_this->psz_object_type;
- msg.psz_module = strdup( psz_module );
+ msg.psz_module = psz_module;
msg.psz_msg = psz_str;
char *psz_header = NULL;
@@ -439,7 +439,6 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
sub->func (sub->opaque, &msg, 0);
}
vlc_rwlock_unlock (&bank->lock);
- free (msg.psz_module);
free (msg.psz_msg);
free (msg.psz_header);
}
More information about the vlc-commits
mailing list