Commit 6fe50dc5 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix memory leak.

parent 8ebee7c8
Pipeline #1539 passed with stages
in 1 minute and 22 seconds
#!/bin/sh
#!/usr/bin/env bash
which valgrind
......@@ -13,8 +13,8 @@ check() {
to="timeout -s INT 30 "
valgrind="valgrind --tool=memcheck --track-origins=yes --leak-check=full --show-leak-kinds=all --error-exitcode=1"
$to $valgrind ./bin/receiver 5000 256 receiver.csv &
$to $valgrind ./bin/sender 127.0.0.1 5000 256 sender.csv
$to $valgrind ./bin/receiver 5000 127 receiver.csv &
$to $valgrind ./bin/sender 127.0.0.1 5000 127 sender.csv
check "$?" "sender failed"
wait
......
......@@ -9,16 +9,9 @@ PrrtCodingParams *PrrtCodingParams_create(void)
check_mem(cpar);
pthread_mutex_init(&cpar->lock, NULL);
cpar->coder = NULL;
cpar->k = 0;
cpar->n = 0;
PrrtCodingParams_update(cpar, K_START, N_START);
cpar->c = 1;
cpar->n_cycle = (uint8_t*) calloc(sizeof(uint8_t), cpar->c);
cpar->n_cycle[0] = (cpar->n - cpar->k);
return cpar;
error:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment