comparison th_datastruct.c @ 732:d190dccc3ee6

Fix free.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Dec 2022 00:17:57 +0200
parents 98d12f33da7b
children 79d06eb6d39f
comparison
equal deleted inserted replaced
731:98d12f33da7b 732:d190dccc3ee6
312 if ((*buf = th_malloc0(sizeof(th_ringbuf_t))) == NULL) 312 if ((*buf = th_malloc0(sizeof(th_ringbuf_t))) == NULL)
313 return THERR_MALLOC; 313 return THERR_MALLOC;
314 314
315 if ((res = th_ringbuf_init(*buf, size, mdeallocator)) != THERR_OK) 315 if ((res = th_ringbuf_init(*buf, size, mdeallocator)) != THERR_OK)
316 { 316 {
317 th_free(buf); 317 th_free(*buf);
318 return res; 318 return res;
319 } 319 }
320 320
321 (*buf)->allocated = TRUE; 321 (*buf)->allocated = TRUE;
322 322