projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
ctdlsh: don't crash on the mailq command if the queue is empty.
[citadel.git]
/
ctdlsh
/
mailq.c
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);
}