Skip to content

Commit

Permalink
MessageQueueItem: remove const-ness from msg_
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed May 27, 2021
1 parent 80b86f3 commit a2296ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/lib/message.cc
Expand Up @@ -1568,7 +1568,7 @@ void Qmsg(JobControlRecord* jcr, int type, utime_t mtime, const char* fmt, ...)
// If no jcr or no JobId or no queue or dequeuing send to syslog
if (!jcr || !jcr->JobId || !jcr->msg_queue || jcr->dequeuing_msgs) {
syslog(LOG_DAEMON | LOG_ERR, "%s", item->msg_);
free(const_cast<char*>(item->msg_));
free(item->msg_);
item->msg_ = nullptr;
free(item);
} else {
Expand All @@ -1590,7 +1590,7 @@ void DequeueMessages(JobControlRecord* jcr)
jcr->dequeuing_msgs = true;
foreach_dlist (item, jcr->msg_queue) {
Jmsg(jcr, item->type_, item->mtime_, "%s", item->msg_);
free(const_cast<char*>(item->msg_));
free(item->msg_);
item->msg_ = nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/message_queue_item.h
Expand Up @@ -35,7 +35,7 @@ class MessageQueueItem {
dlink link_;
int type_ = 0;
utime_t mtime_ = {0};
const char* msg_{nullptr};
char* msg_{nullptr};
};


Expand Down

0 comments on commit a2296ca

Please sign in to comment.