Commit 5d81c926 authored by Rémi Duraffort's avatar Rémi Duraffort

Macro safety.

parent d196ebc5
......@@ -423,12 +423,12 @@ static void free_track( track_elem_t *p_track )
if ( !p_track )
return;
FREE( p_track->name )
FREE( p_track->artist )
FREE( p_track->album )
FREE( p_track->genre )
FREE( p_track->trackNum )
FREE( p_track->location )
FREENULL( p_track->name );
FREENULL( p_track->artist );
FREENULL( p_track->album );
FREENULL( p_track->genre );
FREENULL( p_track->trackNum );
FREENULL( p_track->location );
p_track->duration = 0;
free( p_track );
}
......
......@@ -26,12 +26,11 @@
*/
/* defines */
#define FREE(v) free(v);v=NULL;
#define FREE_NAME() free(psz_name);psz_name=NULL;
#define FREE_VALUE() free(psz_value);psz_value=NULL;
#define FREE_KEY() free(psz_key);psz_key=NULL;
#define FREE_ATT() FREE_NAME();FREE_VALUE()
#define FREE_ATT_KEY() FREE_NAME();FREE_VALUE();FREE_KEY()
#define FREE_NAME() FREENULL( psz_name )
#define FREE_VALUE() FREENULL( psz_value )
#define FREE_KEY() FREENULL( psz_key )
#define FREE_ATT() do{ FREE_NAME();FREE_VALUE(); }while(0)
#define FREE_ATT_KEY() do{ FREE_NAME();FREE_VALUE();FREE_KEY();} while(0)
#define UNKNOWN_CONTENT 0
#define SIMPLE_CONTENT 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment