libctrl: only free() msgb if it was alloc()ed

Before this patch a SIGABRT was caused when doing e.g.:
$ ncat 127.0.0.1 4249
^C
This commit is contained in:
Alexander Huemer 2011-10-12 00:29:30 +02:00 committed by Harald Welte
parent 4376bcc1b0
commit 1d3634e0cb
1 changed files with 1 additions and 1 deletions

View File

@ -208,7 +208,7 @@ static int handle_control_read(struct osmo_fd * bfd)
struct ctrl_connection *ccon;
struct ipaccess_head *iph;
struct ipaccess_head_ext *iph_ext;
struct msgb *msg;
struct msgb *msg = NULL;
struct ctrl_cmd *cmd;
struct ctrl_handle *ctrl = bfd->data;