#include <tiffio.h>
#include "spandsp/telephony.h"
+#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/queue.h"
{
if (s->tx_info.nsf)
{
- free(s->tx_info.nsf);
+ span_free(s->tx_info.nsf);
s->tx_info.nsf = NULL;
}
s->tx_info.nsf_len = 0;
if (s->tx_info.nsc)
{
- free(s->tx_info.nsc);
+ span_free(s->tx_info.nsc);
s->tx_info.nsc = NULL;
}
s->tx_info.nsc_len = 0;
if (s->tx_info.nss)
{
- free(s->tx_info.nss);
+ span_free(s->tx_info.nss);
s->tx_info.nss = NULL;
}
s->tx_info.nss_len = 0;
if (s->tx_info.tsa)
{
- free(s->tx_info.tsa);
+ span_free(s->tx_info.tsa);
s->tx_info.tsa = NULL;
}
if (s->tx_info.ira)
{
- free(s->tx_info.ira);
+ span_free(s->tx_info.ira);
s->tx_info.ira = NULL;
}
if (s->tx_info.cia)
{
- free(s->tx_info.cia);
+ span_free(s->tx_info.cia);
s->tx_info.cia = NULL;
}
if (s->tx_info.isp)
{
- free(s->tx_info.isp);
+ span_free(s->tx_info.isp);
s->tx_info.isp = NULL;
}
if (s->tx_info.csa)
{
- free(s->tx_info.csa);
+ span_free(s->tx_info.csa);
s->tx_info.csa = NULL;
}
if (s->rx_info.nsf)
{
- free(s->rx_info.nsf);
+ span_free(s->rx_info.nsf);
s->rx_info.nsf = NULL;
}
s->rx_info.nsf_len = 0;
if (s->rx_info.nsc)
{
- free(s->rx_info.nsc);
+ span_free(s->rx_info.nsc);
s->rx_info.nsc = NULL;
}
s->rx_info.nsc_len = 0;
if (s->rx_info.nss)
{
- free(s->rx_info.nss);
+ span_free(s->rx_info.nss);
s->rx_info.nss = NULL;
}
s->rx_info.nss_len = 0;
if (s->rx_info.tsa)
{
- free(s->rx_info.tsa);
+ span_free(s->rx_info.tsa);
s->rx_info.tsa = NULL;
}
if (s->rx_info.ira)
{
- free(s->rx_info.ira);
+ span_free(s->rx_info.ira);
s->rx_info.ira = NULL;
}
if (s->rx_info.cia)
{
- free(s->rx_info.cia);
+ span_free(s->rx_info.cia);
s->rx_info.cia = NULL;
}
if (s->rx_info.isp)
{
- free(s->rx_info.isp);
+ span_free(s->rx_info.isp);
s->rx_info.isp = NULL;
}
if (s->rx_info.csa)
{
- free(s->rx_info.csa);
+ span_free(s->rx_info.csa);
s->rx_info.csa = NULL;
}
}
{
uint8_t *t;
- if ((t = malloc(len - 1)) == NULL)
+ if ((t = span_alloc(len - 1)) == NULL)
return 0;
memcpy(t, pkt + 1, len - 1);
*msg = t;
{
if (s == NULL)
{
- if ((s = (t30_state_t *) malloc(sizeof(*s))) == NULL)
+ if ((s = (t30_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
}
memset(s, 0, sizeof(*s));
SPAN_DECLARE(int) t30_free(t30_state_t *s)
{
t30_release(s);
- free(s);
+ span_free(s);
return 0;
}
/*- End of function --------------------------------------------------------*/
#include <tiffio.h>
#include "spandsp/telephony.h"
+#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/async.h"
allocated = FALSE;
if (s == NULL)
{
- if ((s = (t4_rx_state_t *) malloc(sizeof(*s))) == NULL)
+ if ((s = (t4_rx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
allocated = TRUE;
}
#include <tiffio.h>
#include "spandsp/telephony.h"
+#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/bit_operations.h"
#include "spandsp/async.h"
if (len > biggest)
biggest = len;
}
- if ((raw_data = malloc(biggest)) == NULL)
+ if ((raw_data = span_alloc(biggest)) == NULL)
return -1;
s->tiff.image_size = s->tiff.image_length*((s->tiff.image_width + 7)/8);
total_image_len = 0;
for (i = 0; i < num_strips; i++)
total_image_len += TIFFRawStripSize(s->tiff.tiff_file, i);
- if ((raw_data = malloc(total_image_len)) == NULL)
+ if ((raw_data = span_alloc(total_image_len)) == NULL)
return -1;
total_len = 0;
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW);
image_size = 3*s->metadata.image_length*s->metadata.image_width;
- if ((*buf = malloc(image_size)) == NULL)
+ if ((*buf = span_alloc(image_size)) == NULL)
return -1;
pack.buf = *buf;
for (i = 0; i < num_strips; i++)
total_image_len += TIFFRawStripSize(s->tiff.tiff_file, i);
- if ((raw_data = malloc(total_image_len)) == NULL)
+ if ((raw_data = span_alloc(total_image_len)) == NULL)
return -1;
total_len = 0;
if (s->header_text == NULL)
{
- if ((s->header_text = malloc(132 + 1)) == NULL)
+ if ((s->header_text = span_alloc(132 + 1)) == NULL)
return -1;
}
/* This is very English oriented, but then most FAX machines are, too. Some
allocated = FALSE;
if (s == NULL)
{
- if ((s = (t4_tx_state_t *) malloc(sizeof(*s))) == NULL)
+ if ((s = (t4_tx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
allocated = TRUE;
}
#include "floating_fudge.h"
#include "spandsp/telephony.h"
+#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/fast_convert.h"
#include "spandsp/math_fixed.h"
}
if (s == NULL)
{
- if ((s = (v17_rx_state_t *) malloc(sizeof(*s))) == NULL)
+ if ((s = (v17_rx_state_t *) span_alloc(sizeof(*s))) == NULL)
return NULL;
}
memset(s, 0, sizeof(*s));
SPAN_DECLARE(int) v17_rx_free(v17_rx_state_t *s)
{
- free(s);
+ span_free(s);
return 0;
}
/*- End of function --------------------------------------------------------*/