if ( stat ( buffer, &foo ) == 0 ) {
strcpy ( pnd_locate_buffer, buffer );
+ wordfree( &_p );
return ( pnd_locate_buffer );
}
FILE *f;
char *b;
unsigned int len;
+ pnd_pxml_handle *h;
f = fopen ( fullpath, "r" );
fclose ( f );
- return ( pnd_pxml_fetch_buffer ( fullpath, b ) );
+ h = pnd_pxml_fetch_buffer ( fullpath, b );
+ free ( b );
+
+ return ( h );
}
pnd_pxml_handle *pnd_pxml_fetch_buffer ( char *filename, char *buffer ) {
if ( p -> execargs ) {
free ( p -> execargs );
}
+ if ( p -> mkdir_sp ) {
+ free ( p -> mkdir_sp );
+ }
if ( p -> package_version_major ) {
free ( p -> package_version_major );
}
char *filetype = pnd_pxml_get_attribute(pElem, PND_PXML_ATTRNAME_ASSOCFTYPE);
char *paramter = pnd_pxml_get_attribute(pElem, PND_PXML_ATTRNAME_ASSOCARGS);
- if (!(name && filetype && paramter)) continue;
+ if (!(name && filetype && paramter))
+ {
+ if(name) free(name);
+ if(filetype) free(filetype);
+ if(paramter) free(paramter);
+ continue;
+ }
switch(i) //TODO: same problem here: only 3 associations supported
{
app->associationitem3_parameter = paramter;
}
}
+ if(name) free(name);
+ if(filetype) free(filetype);
+ if(paramter) free(paramter);
}
}
if ( ( t = pnd_pxml_get_attribute(pElem, PND_PXML_ATTRNAME_MKDIRPATH) ) ) {
// first <dir>, so just replace it wholesale; we use strdup so we can free() easily later, consistently. Mmm, leak seems imminent.
app -> mkdir_sp = strdup ( t );
+ free(t); // free this attribute
}
while ( ( pElem = pElem -> NextSiblingElement ( PND_PXML_ENAME_MKDIR ) ) ) {
app -> mkdir_sp = foo;
} // assuming we got ram, lets cat it all together
+ free(t); // free this attribute
} // got another elem?
} // while