Hi,
This is ravi rajeev working with TCS. I have problem with wild pointers. In the following code i am not able to find out the wild pointer .If some one will give me some idea how to find wild pointer and how to eliminate it,i will be greatful to you.
Following is the part of code (i.e. function) in which there is wild pointer as per my reviewer comments,
Code:
static void
handleGetLHName(union SIGNAL *sigrec_p) /* This function is called when CELLO_PIU3_GET_LH_NAME_CFM signal is received */
{
union SIGNAL *huntSig_p;
char *lnhName_p;
U8 huntPath_p[100];
U32 piuId;
XpResource *xp_p;
ENTER("handleGetLHName");
huntSig_p = alloc(sizeof(OsaXpHuntFanSupervisionServer),
OSA_XP_HUNT_FANSUPERVISION_SERVER);
huntSig_p->OsaXpHuntFanSupervisionServer_r.xpInstanceId = xp_p->xpInstanceId;
huntSig_p->OsaXpHuntFanSupervisionServer_r.piuId = piuId;
/* Change the state of the fan supervision server. */
if(xp_p->fanSupervisionServer1.piuId == piuId)
{
xp_p->fanSupervisionServer1.state = FAN_SUPERVISION_SERVER_HUNTING;
TRACE(7, STR("fanSupervisionServer1 state: %d",
xp_p->fanSupervisionServer1.state));
}
else if(xp_p->fanSupervisionServer2.piuId == piuId)
{
xp_p->fanSupervisionServer2.state = FAN_SUPERVISION_SERVER_HUNTING;
TRACE(7, STR("fanSupervisionServer2 state: %d",
xp_p->fanSupervisionServer2.state));
}
else
{
TRACE_ERROR(STR("\n%s \n%s%d",
"Unknown piuId for fan supervision server.",
"piuId: ", piuId));
}
/* Create the hunt path. */
strcpy(huntPath_p, lnhName_p);
strcat(huntPath_p, "/");
strcat(huntPath_p, OSA_FAN_SUPERVISION_PROC_NAME);
hunt(huntPath_p, (OSUSER)0, 0, &huntSig_p);
/* The linkhandler string needs to be deallocated according
to the User's Guide for PRI. */
FREE_BUF((union SIGNAL **)&lnhName_p);
RETURN;
}