Hi,

I am finding some problem with the data context variables. I am allocating memory for 
my structures and storing the value in my_data_context variables in 
XXX_get_first_data_point() function such as

typedef xx struct XXXTable{
   ........
   ........
}

XXX_get_first_data_point(void **my_loop_context,
                         void **my_data_context,
                         netsnmp_variable_list *
                         put_index_data,
                         netsnmp_iterator_info *mydata)
{
     xx = calloc(20); /* allocated here */
     xx = /* some data stored here */

    *my_data_context = (void *)&xx[i];
     
}

But, I do not know where to free my allocated structures. 

I found a method called XXXTable_data_free() in initialize_table_XXX() method, and it 
is given inside the mcacro MAYBE_USE_THESE. So, I have taken the line 

iinfo->free_data_context = XXXTable_data_free;

and the method definition of my data_free will look like as follows :

XXXTable_data_free(void *data, netsnmp_iterator_info *iinfo)
{
    free(data);
}


But, When I compile and run the program, I am not able to see the output and seems 
like my data was freed before sending the response to the manager. Please let me know, 
the above procedure I am following was correct or am I missing something?? If so, let 
me know the ways to free my allocated structures.


Thanks & Regards,
Karthik. N

-- 
______________________________________________
IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com 
Check out our value-added Premium features, such as an extra 20MB for mail storage, 
POP3, e-mail forwarding, and ads-free mailboxes!

Powered by Outblaze


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to