Avoid calling some free() on WIN32 on memory that may be allocated in

another heap.  This is a temporary solution.

svn path=/trunk/; revision=24693
This commit is contained in:
Stig Bjørlykke 2008-03-19 01:02:55 +00:00
parent 664c9aa38a
commit 1aa7d41bed
1 changed files with 12 additions and 0 deletions

View File

@ -291,12 +291,16 @@ const oid_value_type_t* get_typedata(SmiType* smiType) {
for (t = types; t->type ; t++ ) {
char* name = smiRenderType(sT, SMI_RENDER_NAME);
if (name && t->name && g_str_equal(name, t->name )) {
#ifndef WIN32
free (name);
#endif
return t->type;
}
#ifndef WIN32
if (name) {
free (name);
}
#endif
}
} while(( sT = smiGetParentType(sT) ));
@ -384,8 +388,10 @@ static inline oid_kind_t smikind(SmiNode* sN, oid_key_t** key_p) {
oid1 = smiRenderOID(sN->oidlen, sN->oid, SMI_RENDER_QUALIFIED);
oid2 = smiRenderOID(elNode->oidlen, elNode->oid, SMI_RENDER_NAME);
k->name = g_strdup_printf("%s.%s", oid1, oid2);
#ifndef WIN32
free (oid1);
free (oid2);
#endif
k->hfid = -2;
k->ft_type = typedata ? typedata->ft_type : FT_BYTES;
@ -575,7 +581,9 @@ void register_mibs(void) {
key,
smiNode->oidlen,
smiNode->oid);
#ifndef WIN32
free (oid);
#endif
D(4,("\t\tNode: kind=%d oid=%s name=%s ",
oid_data->kind, oid_subid2string(smiNode->oid, smiNode->oidlen), oid_data->name ));
@ -589,7 +597,11 @@ void register_mibs(void) {
typedata->display,
NULL,
0,
#ifndef WIN32
smiRenderOID(smiNode->oidlen, smiNode->oid, SMI_RENDER_ALL),
#else
g_strdup (smiRenderOID(smiNode->oidlen, smiNode->oid, SMI_RENDER_ALL)),
#endif
HFILL }};
oid_data->value_hfid = -1;