|
a/src/unac/unac.c |
|
b/src/unac/unac.c |
|
... |
|
... |
13168 |
/* +1 for null */
|
13168 |
/* +1 for null */
|
13169 |
out = realloc(out, out_size + 1);
|
13169 |
out = realloc(out, out_size + 1);
|
13170 |
if(out == 0) {
|
13170 |
if(out == 0) {
|
13171 |
if(debug_level >= UNAC_DEBUG_LOW)
|
13171 |
if(debug_level >= UNAC_DEBUG_LOW)
|
13172 |
DEBUG("realloc %d bytes failed\n", out_size+1);
|
13172 |
DEBUG("realloc %d bytes failed\n", out_size+1);
|
13173 |
// *outp is still valid. Let the caller free it
|
13173 |
/* *outp is still valid. Let the caller free it */
|
13174 |
return -1;
|
13174 |
return -1;
|
13175 |
}
|
13175 |
}
|
13176 |
} else {
|
13176 |
} else {
|
13177 |
/* +1 for null */
|
13177 |
/* +1 for null */
|
13178 |
out = malloc(out_size + 1);
|
13178 |
out = malloc(out_size + 1);
|
|
... |
|
... |
13300 |
if(*outp) {
|
13300 |
if(*outp) {
|
13301 |
out = *outp;
|
13301 |
out = *outp;
|
13302 |
/* +1 for null */
|
13302 |
/* +1 for null */
|
13303 |
out = realloc(out, out_size + 1);
|
13303 |
out = realloc(out, out_size + 1);
|
13304 |
if(out == 0) {
|
13304 |
if(out == 0) {
|
13305 |
// *outp still valid, no freeing
|
13305 |
/* *outp still valid, no freeing */
|
13306 |
if(debug_level >= UNAC_DEBUG_LOW)
|
13306 |
if(debug_level >= UNAC_DEBUG_LOW)
|
13307 |
DEBUG("realloc %d bytes failed\n", out_size+1);
|
13307 |
DEBUG("realloc %d bytes failed\n", out_size+1);
|
13308 |
return -1;
|
13308 |
return -1;
|
13309 |
}
|
13309 |
}
|
13310 |
} else {
|
13310 |
} else {
|
|
... |
|
... |
13373 |
{
|
13373 |
{
|
13374 |
char *saved = out_base;
|
13374 |
char *saved = out_base;
|
13375 |
/* +1 for null */
|
13375 |
/* +1 for null */
|
13376 |
out_base = realloc(out_base, out_size + 1);
|
13376 |
out_base = realloc(out_base, out_size + 1);
|
13377 |
if (out_base == 0) {
|
13377 |
if (out_base == 0) {
|
13378 |
// *outp potentially not valid any more. Free here,
|
13378 |
/* *outp potentially not valid any more. Free here,
|
13379 |
// and zero out
|
13379 |
* and zero out */
|
13380 |
if(debug_level >= UNAC_DEBUG_LOW)
|
13380 |
if(debug_level >= UNAC_DEBUG_LOW)
|
13381 |
DEBUG("realloc %d bytes failed\n", out_size+1);
|
13381 |
DEBUG("realloc %d bytes failed\n", out_size+1);
|
13382 |
free(saved);
|
13382 |
free(saved);
|
13383 |
*outp = 0;
|
13383 |
*outp = 0;
|
13384 |
return -1;
|
13384 |
return -1;
|