timeshift: fix memory leak in reader

I had failed to zero the ref count after reading from disk, this
will garauntee that the refcount never actually reaches zero and
is therefore the pkt is leaked.
This commit is contained in:
Adam Sutton 2013-01-09 12:14:46 +00:00
parent 9180546fc6
commit 4e67a1345e

View file

@ -137,7 +137,8 @@ static ssize_t _read_msg ( int fd, streaming_message_t **sm )
}
if (type == SMT_PACKET) {
th_pkt_t *pkt = data;
pkt->pkt_payload = pkt->pkt_header = NULL;
pkt->pkt_payload = pkt->pkt_header = NULL;
pkt->pkt_refcount = 0;
*sm = streaming_msg_create_pkt(pkt);
r = _read_pktbuf(fd, &pkt->pkt_header);
if (r < 0) {