Skip to content

Commit

Permalink
Correct APR pool used for override hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
satterly committed Oct 20, 2012
1 parent 4c63db2 commit fb842f9
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions gmond/gmond.c
Expand Up @@ -2750,17 +2750,7 @@ Ganglia_collection_group_send( Ganglia_collection_group *group, apr_time_t now)
name = cb->msg.Ganglia_value_msg_u.gstr.metric_id.name;
if (override_hostname != NULL)
{
#if 0
char* tmpstr = malloc( strlen(( override_ip != NULL ? override_ip : override_hostname )) + strlen( override_hostname ) + 1 );
strcpy (tmpstr, (char *)( override_ip != NULL ? override_ip : override_hostname ) );
strcat (tmpstr, ":");
strcat (tmpstr, (char *) override_hostname);

cb->msg.Ganglia_value_msg_u.gstr.metric_id.host = tmpstr;
#endif
#if 1
cb->msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrcat(gm_pool, (char *)( override_ip != NULL ? override_ip : override_hostname ), ":", (char *) override_hostname, NULL);
#endif
cb->msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrcat(global_context, (char *)( override_ip != NULL ? override_ip : override_hostname ), ":", (char *) override_hostname, NULL);
cb->msg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE;
}
val = apr_pstrdup(gm_pool, host_metric_value(cb->info, &(cb->msg)));
Expand Down

0 comments on commit fb842f9

Please sign in to comment.