summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-13 14:51:00 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-13 14:51:00 +0000
commit860723ad456840e5ae320151822cce317ac65e51 (patch)
tree20830366bbfafb55898b3e4ad3213a807f8e0895
parentd191ac8cf98a465a8cc0039dcdcb36ee2c8a86f8 (diff)
don't leak event infos when no cb is set for pulse events
SVN revision: 80873
-rw-r--r--serial.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/serial.c b/serial.c
index 0ec7203..277d06c 100644
--- a/serial.c
+++ b/serial.c
@@ -139,10 +139,10 @@ deserialize_tag(Pulse *conn, PA_Commands command, Pulse_Tag *tag)
139 if (!cb) return EINA_TRUE; 139 if (!cb) return EINA_TRUE;
140 ev = NULL; 140 ev = NULL;
141 ev = deserialize_server_info(conn, tag); 141 ev = deserialize_server_info(conn, tag);
142 if (!cb) pulse_server_info_free(ev);
142 break; 143 break;
143 case PA_COMMAND_GET_SINK_INFO_LIST: 144 case PA_COMMAND_GET_SINK_INFO_LIST:
144 case PA_COMMAND_GET_SOURCE_INFO_LIST: 145 case PA_COMMAND_GET_SOURCE_INFO_LIST:
145 if (!cb) return EINA_TRUE;
146 ev = NULL; 146 ev = NULL;
147 while (tag->size < tag->dsize - PA_TAG_SIZE_STRING_NULL) 147 while (tag->size < tag->dsize - PA_TAG_SIZE_STRING_NULL)
148 { 148 {
@@ -155,13 +155,16 @@ deserialize_tag(Pulse *conn, PA_Commands command, Pulse_Tag *tag)
155 pulse_sink_free(sink); 155 pulse_sink_free(sink);
156 break; 156 break;
157 } 157 }
158 ev = eina_list_append(ev, sink); 158 if (!cb) pulse_sink_free(sink);
159 else
160 ev = eina_list_append(ev, sink);
159 } 161 }
160 break; 162 break;
161 case PA_COMMAND_GET_SINK_INFO: 163 case PA_COMMAND_GET_SINK_INFO:
162 case PA_COMMAND_GET_SOURCE_INFO: 164 case PA_COMMAND_GET_SOURCE_INFO:
163 if ((!cb) && (!conn->watching)) return EINA_TRUE; 165 if ((!cb) && (!conn->watching)) return EINA_TRUE;
164 ev = deserialize_sink(conn, tag, (command == PA_COMMAND_GET_SOURCE_INFO)); 166 ev = deserialize_sink(conn, tag, (command == PA_COMMAND_GET_SOURCE_INFO));
167 if (!cb) pulse_sink_free(ev);
165 break; 168 break;
166 case 0: 169 case 0:
167 deserialize_sinks_watcher(conn, tag); 170 deserialize_sinks_watcher(conn, tag);