projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b94961
)
ctdlsh: don't crash on the mailq command if the queue is empty.
author
Art Cancro
<ajc@citadel.org>
Sun, 19 Nov 2017 21:32:47 +0000
(16:32 -0500)
committer
Art Cancro
<ajc@citadel.org>
Sun, 19 Nov 2017 21:32:47 +0000
(16:32 -0500)
ctdlsh/mailq.c
patch
|
blob
|
history
diff --git
a/ctdlsh/mailq.c
b/ctdlsh/mailq.c
index 772c242302e7a060fc8acbf6d65032267db5a0b7..d6ed794aaed771b614afa180c11e73dc36e47c2b 100644
(file)
--- a/
ctdlsh/mailq.c
+++ b/
ctdlsh/mailq.c
@@
-42,7
+42,7
@@
void mailq_show_this_queue_entry(StrBuf *MsgText) {
int cmd_mailq(int server_socket, char *cmdbuf) {
char buf[1024];
- long *msgs;
+ long *msgs
= NULL
;
int num_msgs = 0;
int num_alloc = 0;
int i;
@@
-91,7
+91,9
@@
int cmd_mailq(int server_socket, char *cmdbuf) {
}
}
- free(msgs);
+ if (msgs != NULL) {
+ free(msgs);
+ }
FreeStrBuf(&MsgText);
return(cmdret_ok);
}