[vlc-commits] [Git][videolan/vlc][master] 2 commits: messages: fix header copy leak
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Aug 10 12:27:32 UTC 2022
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
f4ff18f2 by Steve Lhomme at 2022-08-10T12:05:39+00:00
messages: fix header copy leak
- - - - -
dc9511c2 by Steve Lhomme at 2022-08-10T12:05:39+00:00
messages: don't generate a message if there's no logger.
- - - - -
1 changed file:
- src/misc/messages.c
Changes:
=====================================
src/misc/messages.c
=====================================
@@ -121,6 +121,10 @@ void vlc_vaLog(struct vlc_logger *const *loggerp, int type,
const char *format, va_list args)
{
struct vlc_logger *logger = *loggerp;
+ if (logger == NULL)
+ // nothing to do
+ return;
+
/* Get basename from the module filename */
char *p = strrchr(module, '/');
if (p != NULL)
@@ -149,8 +153,7 @@ void vlc_vaLog(struct vlc_logger *const *loggerp, int type,
msg.tid = vlc_thread_id();
/* Pass message to the callback */
- if (logger != NULL)
- vlc_vaLogCallback(logger, type, &msg, format, args);
+ vlc_vaLogCallback(logger, type, &msg, format, args);
}
void vlc_Log(struct vlc_logger *const *logger, int type,
@@ -232,6 +235,7 @@ static void vlc_LogEarlyClose(void *d)
vlc_LogCallback(sink, log->type, &log->meta, "%s",
(log->msg != NULL) ? log->msg : "message lost");
free(log->msg);
+ free((char*)log->meta.psz_header); // local copy
next = log->next;
free(log);
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/52cda8377ebcccd70a5af409b68ab5b39b79d1ce...dc9511c282ec329e2ee22e1443cba825a8c4e144
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/52cda8377ebcccd70a5af409b68ab5b39b79d1ce...dc9511c282ec329e2ee22e1443cba825a8c4e144
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list