/*
- * $Id: target_manager.c 44 2011-02-15 12:32:29Z kaori $
+ * $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
{
targetlist_param_t *targetlist;
- targetlist = (targetlist_param_t *)malloc( sizeof(targetlist_param_t));
+ targetlist = (targetlist_param_t *)opj_malloc( sizeof(targetlist_param_t));
targetlist->first = NULL;
targetlist->last = NULL;
return NULL;
}
- target = (target_param_t *)malloc( sizeof(target_param_t));
+ target = (target_param_t *)opj_malloc( sizeof(target_param_t));
snprintf( target->tid, MAX_LENOFTID, "%x-%x", (unsigned int)time(NULL), (unsigned int)rand());
target->targetname = strdup( targetpath);
target->fd = fd;
fprintf( logstream, "local log: target: %s deleted\n", (*target)->targetname);
#endif
- free( (*target)->targetname);
+ opj_free( (*target)->targetname);
- free(*target);
+ opj_free(*target);
}
void delete_target_in_list( target_param_t **target, targetlist_param_t *targetlist)
delete_target( &targetPtr);
targetPtr=targetNext;
}
- free( *targetlist);
+ opj_free( *targetlist);
}
void print_target( target_param_t *target)
return -1;
}
- data = (char *)malloc( 12); /* size of header*/
+ data = (char *)opj_malloc( 12); /* size of header*/
if( read( fd, data, 12) != 12){
- free( data);
+ opj_free( data);
close(fd);
fprintf( FCGI_stdout, "Reason: Target %s broken (read error)\r\n", filepath);
return -1;
if( *data || *(data + 1) || *(data + 2) ||
*(data + 3) != 12 || strncmp (data + 4, "jP \r\n\x87\n", 8)){
- free( data);
+ opj_free( data);
close(fd);
fprintf( FCGI_stdout, "Reason: No JPEG 2000 Signature box in target %s\r\n", filepath);
return -1;
}
- free( data);
+ opj_free( data);
return fd;
}