1
1

Cleaning up memory leaks for proxy operations.

This commit was SVN r7157.
Этот коммит содержится в:
Ralph Castain 2005-09-02 19:26:21 +00:00
родитель 4bd25e0292
Коммит f352890732
3 изменённых файлов: 24 добавлений и 6 удалений

Просмотреть файл

@ -76,6 +76,9 @@ int orte_gpr_replica_recv_increment_value_cmd(orte_buffer_t *cmd, orte_buffer_t
free(itags); free(itags);
} }
/* release value object */
OBJ_RELEASE(value);
if (ORTE_SUCCESS == ret) { if (ORTE_SUCCESS == ret) {
if (ORTE_SUCCESS != if (ORTE_SUCCESS !=
(rc = orte_gpr_replica_check_events())) { (rc = orte_gpr_replica_check_events())) {
@ -139,6 +142,9 @@ int orte_gpr_replica_recv_decrement_value_cmd(orte_buffer_t *cmd, orte_buffer_t
free(itags); free(itags);
} }
/* release value object */
OBJ_RELEASE(value);
if (ORTE_SUCCESS == ret) { if (ORTE_SUCCESS == ret) {
if (ORTE_SUCCESS != if (ORTE_SUCCESS !=
(rc = orte_gpr_replica_check_events())) { (rc = orte_gpr_replica_check_events())) {

Просмотреть файл

@ -59,6 +59,8 @@ int orte_gpr_replica_recv_delete_segment_cmd(orte_buffer_t *buffer, orte_buffer_
} }
RETURN_ERROR: RETURN_ERROR:
if (NULL != segment) free(segment);
if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) { if (ORTE_SUCCESS != (rc = orte_dps.pack(answer, &ret, 1, ORTE_INT))) {
ORTE_ERROR_LOG(rc); ORTE_ERROR_LOG(rc);
return rc; return rc;
@ -169,15 +171,17 @@ int orte_gpr_replica_recv_delete_entries_cmd(orte_buffer_t *buffer, orte_buffer_
if (NULL != tokens) { if (NULL != tokens) {
for (i=0; i<num_tokens; i++) { for (i=0; i<num_tokens; i++) {
free(tokens[i]); free(tokens[i]);
tokens[i] = NULL;
} }
free(tokens); if (NULL != tokens) free(tokens);
} }
if (NULL != keys) { if (NULL != keys) {
for (i=0; i<num_keys; i++) { for (i=0; i<num_keys; i++) {
free(keys[i]); free(keys[i]);
keys[i] = NULL;
} }
free(keys); if (NULL != keys) free(keys);
} }
if (NULL != token_itags) { if (NULL != token_itags) {

Просмотреть файл

@ -152,17 +152,25 @@ int orte_gpr_replica_recv_subscribe_cmd(orte_process_name_t* sender,
num_subs, subscriptions, num_subs, subscriptions,
num_trigs, trigs))) { num_trigs, trigs))) {
ORTE_ERROR_LOG(rc); ORTE_ERROR_LOG(rc);
OPAL_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex); goto RETURN_ERROR;
return rc;
} }
if (ORTE_SUCCESS != (rc = orte_gpr_replica_check_events())) { if (ORTE_SUCCESS != (rc = orte_gpr_replica_check_events())) {
ORTE_ERROR_LOG(rc); ORTE_ERROR_LOG(rc);
OPAL_THREAD_UNLOCK(&orte_gpr_replica_globals.mutex);
return rc;
} }
RETURN_ERROR: RETURN_ERROR:
/* release the subscription objects, if any */
if (NULL != subscriptions) {
for (n=0; n < num_subs; n++) OBJ_RELEASE(subscriptions[n]);
if (NULL != subscriptions) free(subscriptions);
}
/* release the trigger objects, if any */
if (NULL != trigs) {
for (n=0; n < num_trigs; n++) OBJ_RELEASE(trigs[n]);
if (NULL != trigs) free(trigs);
}
if (ORTE_SUCCESS != (ret = orte_dps.pack(output_buffer, &rc, 1, ORTE_INT))) { if (ORTE_SUCCESS != (ret = orte_dps.pack(output_buffer, &rc, 1, ORTE_INT))) {
ORTE_ERROR_LOG(ret); ORTE_ERROR_LOG(ret);
return ret; return ret;