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:
parent
9180546fc6
commit
4e67a1345e
1 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue