summaryrefslogtreecommitdiffstats
path: root/util/src/platforms/os400
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/platforms/os400')
-rw-r--r--util/src/platforms/os400/thread_os400.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/util/src/platforms/os400/thread_os400.c b/util/src/platforms/os400/thread_os400.c
index 0269f9e..8f1abf7 100644
--- a/util/src/platforms/os400/thread_os400.c
+++ b/util/src/platforms/os400/thread_os400.c
@@ -28,11 +28,9 @@ axutil_threadattr_create(
new = AXIS2_MALLOC(allocator, sizeof(axutil_threadattr_t));
if (!new)
- {
return NULL;
- }
- stat = pthread_attr_init(&(new->attr));
+ stat = pthread_attr_init(&(new->attr));
if (stat != 0)
{
AXIS2_FREE(allocator, new);
@@ -107,12 +105,12 @@ axutil_thread_create(
new = (axutil_thread_t *) AXIS2_MALLOC(allocator, sizeof(axutil_thread_t));
if (!new)
- {
return NULL;
- }
+
new->td = (pthread_t *) AXIS2_MALLOC(allocator, sizeof(pthread_t));
if (!new->td)
{
+ AXIS2_FREE(allocator, new);
return NULL;
}
@@ -121,18 +119,15 @@ axutil_thread_create(
new->try_exit = AXIS2_FALSE;
if (attr)
- {
temp = &(attr->attr);
- }
- else
- {
- temp = NULL;
- }
if ((stat = pthread_create(new->td, temp, dummy_worker, new)) == 0)
{
return new;
}
+
+ AXIS2_FREE(allocator, new->td);
+ AXIS2_FREE(allocator, new);
return NULL;
}