From cc10207a6de5466bf6bfedcd8a3073c7a0f1224a Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Duraffort?= Date: Wed, 12 Mar 2008 11:54:45 +0100 Subject: [PATCH] Another bunch of useless test. --- modules/misc/freetype.c | 65 +++++++++++-------------- modules/misc/osd/osd_menu.c | 59 ++++++++++------------ modules/misc/osd/simple.c | 5 +- modules/misc/quartztext.c | 5 +- modules/misc/rtsp.c | 53 ++++++++++---------- modules/misc/win32text.c | 4 +- modules/misc/xml/xtag.c | 11 +++-- modules/visualization/galaktos/plugin.c | 9 ++-- modules/visualization/goom.c | 9 ++-- modules/visualization/visual/effects.c | 24 +++------ modules/visualization/visual/fft.c | 2 +- 11 files changed, 107 insertions(+), 139 deletions(-) diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c index 7a64431c6a..3ba7a4085e 100644 --- a/modules/misc/freetype.c +++ b/modules/misc/freetype.c @@ -318,7 +318,7 @@ static int Create( vlc_object_t *p_this ) psz_fontfile = val.psz_string; if( !psz_fontfile || !*psz_fontfile ) { - if( psz_fontfile ) free( psz_fontfile ); + free( psz_fontfile ); psz_fontfile = (char *)malloc( PATH_MAX + 1 ); if( !psz_fontfile ) { @@ -425,7 +425,7 @@ static int Create( vlc_object_t *p_this ) p_sys->i_default_font_size = val.i_int; if( SetFontSize( p_filter, 0 ) != VLC_SUCCESS ) goto error; - if( psz_fontfile ) free( psz_fontfile ); + free( psz_fontfile ); p_sys->pp_font_attachments = NULL; p_sys->i_font_attachments = 0; @@ -444,7 +444,7 @@ static int Create( vlc_object_t *p_this ) error: if( p_sys->p_face ) FT_Done_Face( p_sys->p_face ); if( p_sys->p_library ) FT_Done_FreeType( p_sys->p_library ); - if( psz_fontfile ) free( psz_fontfile ); + free( psz_fontfile ); free( p_sys ); return VLC_EGENERIC; } @@ -1358,12 +1358,12 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out, else RenderYUVA( p_filter, p_region_out, p_lines, result.x, result.y ); - if( psz_unicode_orig ) free( psz_unicode_orig ); + free( psz_unicode_orig ); FreeLines( p_lines ); return VLC_SUCCESS; error: - if( psz_unicode_orig ) free( psz_unicode_orig ); + free( psz_unicode_orig ); FreeLines( p_lines ); return VLC_EGENERIC; } @@ -1393,8 +1393,7 @@ static void DeleteStyle( ft_style_t *p_style ) { if( p_style ) { - if( p_style->psz_fontname ) - free( p_style->psz_fontname ); + free( p_style->psz_fontname ); free( p_style ); } } @@ -1793,7 +1792,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader, { if( !strcasecmp( "face", psz_name ) ) { - if( psz_fontname ) free( psz_fontname ); + free( psz_fontname ); psz_fontname = strdup( psz_value ); } else if( !strcasecmp( "size", psz_name ) ) @@ -1968,8 +1967,8 @@ static void SetupKaraoke( xml_reader_t *p_xml_reader, uint32_t *pi_k_runs, (*ppi_k_run_lengths)[ *pi_k_runs - 1 ] = 0; } } - if( psz_name ) free( psz_name ); - if( psz_value ) free( psz_value ); + free( psz_name ); + free( psz_value ); } } @@ -2291,12 +2290,12 @@ static int ProcessLines( filter_t *p_filter, ! p_levels ) { msg_Err( p_filter, "out of memory" ); - if( p_levels ) free( p_levels ); - if( p_old_positions ) free( p_old_positions ); - if( p_new_positions ) free( p_new_positions ); - if( p_fribidi_string ) free( p_fribidi_string ); - if( pp_char_styles_new ) free( pp_char_styles_new ); - if( pi_karaoke_bar ) free( pi_karaoke_bar ); + free( p_levels ); + free( p_old_positions ); + free( p_new_positions ); + free( p_fribidi_string ); + free( pp_char_styles_new ); + free( pi_karaoke_bar ); free( pp_char_styles ); return VLC_ENOMEM; @@ -2404,8 +2403,8 @@ static int ProcessLines( filter_t *p_filter, i_start_pos += pi_k_run_lengths[ k ]; } } - if( p_levels ) free( p_levels ); - if( p_new_positions ) free( p_new_positions ); + free( p_levels ); + free( p_new_positions ); FT_Vector tmp_result; @@ -2474,8 +2473,7 @@ static int ProcessLines( filter_t *p_filter, #if defined(HAVE_FRIBIDI) free( psz_text ); #endif - if( pi_karaoke_bar ) - free( pi_karaoke_bar ); + free( pi_karaoke_bar ); return VLC_EGENERIC; } free( psz_fontfile ); @@ -2501,8 +2499,7 @@ static int ProcessLines( filter_t *p_filter, #if defined(HAVE_FRIBIDI) free( psz_text ); #endif - if( pi_karaoke_bar ) - free( pi_karaoke_bar ); + free( pi_karaoke_bar ); return VLC_EGENERIC; } p_sys->i_use_kerning = @@ -2520,8 +2517,7 @@ static int ProcessLines( filter_t *p_filter, #if defined(HAVE_FRIBIDI) free( psz_text ); #endif - if( pi_karaoke_bar ) - free( pi_karaoke_bar ); + free( pi_karaoke_bar ); return VLC_ENOMEM; } memcpy( psz_unicode, psz_text + i_prev, @@ -2540,8 +2536,7 @@ static int ProcessLines( filter_t *p_filter, #if defined(HAVE_FRIBIDI) free( psz_text ); #endif - if( pi_karaoke_bar ) - free( pi_karaoke_bar ); + free( pi_karaoke_bar ); return VLC_ENOMEM; } /* New Color mode only works in YUVA rendering mode -- @@ -2575,8 +2570,7 @@ static int ProcessLines( filter_t *p_filter, #if defined(HAVE_FRIBIDI) free( psz_text ); #endif - if( pi_karaoke_bar ) - free( pi_karaoke_bar ); + free( pi_karaoke_bar ); return VLC_EGENERIC; } @@ -2903,14 +2897,13 @@ static line_desc_t *NewLine( int i_count ) ( p_line->pi_underline_offset == NULL ) || ( p_line->pi_underline_thickness == NULL ) ) { - if( p_line->pi_underline_thickness ) - free( p_line->pi_underline_thickness ); - if( p_line->pi_underline_offset ) free( p_line->pi_underline_offset ); - if( p_line->p_fg_rgb ) free( p_line->p_fg_rgb ); - if( p_line->p_bg_rgb ) free( p_line->p_bg_rgb ); - if( p_line->p_fg_bg_ratio ) free( p_line->p_fg_bg_ratio ); - if( p_line->p_glyph_pos ) free( p_line->p_glyph_pos ); - if( p_line->pp_glyphs ) free( p_line->pp_glyphs ); + free( p_line->pi_underline_thickness ); + free( p_line->pi_underline_offset ); + free( p_line->p_fg_rgb ); + free( p_line->p_bg_rgb ); + free( p_line->p_fg_bg_ratio ); + free( p_line->p_glyph_pos ); + free( p_line->pp_glyphs ); free( p_line ); return NULL; } diff --git a/modules/misc/osd/osd_menu.c b/modules/misc/osd/osd_menu.c index 1f6fb3ba98..12616075e2 100644 --- a/modules/misc/osd/osd_menu.c +++ b/modules/misc/osd/osd_menu.c @@ -82,8 +82,8 @@ void osd_MenuFree( osd_menu_t *p_menu ) msg_Dbg( p_menu, "freeing menu" ); osd_ButtonFree( p_menu, p_menu->p_button ); - if( p_menu->psz_path ) free( p_menu->psz_path ); - if( p_menu->p_state ) free( p_menu->p_state ); + free( p_menu->psz_path ); + free( p_menu->p_state ); p_menu->p_button = NULL; p_menu->p_last_button = NULL; @@ -135,18 +135,15 @@ void osd_ButtonFree( osd_menu_t *p_menu, osd_button_t *p_button ) p_current = p_prev; if( p_current->p_next ) { - if( p_current->p_next->psz_name ) - free( p_current->p_next->psz_name ); - if( p_current->p_next->psz_action ) - free( p_current->p_next->psz_action ); - if( p_current->p_next->psz_action_down ) - free( p_current->p_next->psz_action_down ); - if( p_current->p_feedback && p_current->p_feedback->p_data_orig ) - free( p_current->p_feedback->p_data_orig ); + free( p_current->p_next->psz_name ); + free( p_current->p_next->psz_action ); + free( p_current->p_next->psz_action_down ); if( p_current->p_feedback ) + { + free( p_current->p_feedback->p_data_orig ); free( p_current->p_feedback ); - - p_current->p_feedback = NULL; + p_current->p_feedback = NULL; + } /* Free all states first */ if( p_current->p_next->p_states ) @@ -158,16 +155,14 @@ void osd_ButtonFree( osd_menu_t *p_menu, osd_button_t *p_button ) if( p_current->p_up ) { - if( p_current->p_up->psz_name ) - free( p_current->p_up->psz_name ); - if( p_current->p_up->psz_action ) - free( p_current->p_up->psz_action ); - if( p_current->p_up->psz_action_down ) - free( p_current->p_up->psz_action_down ); - if( p_current->p_feedback && p_current->p_feedback->p_data_orig ) - free( p_current->p_feedback->p_data_orig ); + free( p_current->p_up->psz_name ); + free( p_current->p_up->psz_action ); + free( p_current->p_up->psz_action_down ); if( p_current->p_feedback ) + { + free( p_current->p_feedback->p_data_orig ); free( p_current->p_feedback ); + } p_current->p_feedback = NULL; @@ -183,14 +178,15 @@ void osd_ButtonFree( osd_menu_t *p_menu, osd_button_t *p_button ) { msg_Dbg( p_menu, "+ freeing button %s [%p]", p_button->psz_action, p_button ); - if( p_button->psz_name ) free( p_button->psz_name ); - if( p_button->psz_action ) free( p_button->psz_action ); - if( p_button->psz_action_down ) free( p_button->psz_action_down ); - if( p_current->p_feedback && p_current->p_feedback->p_data_orig ) - free( p_current->p_feedback->p_data_orig ); + free( p_button->psz_name ); + free( p_button->psz_action ); + free( p_button->psz_action_down ); if( p_current->p_feedback ) + { + free( p_current->p_feedback->p_data_orig ); free( p_current->p_feedback ); - p_current->p_feedback = NULL; + p_current->p_feedback = NULL; + } if( p_button->p_states ) osd_StatesFree( p_menu, p_button->p_states ); @@ -268,12 +264,10 @@ void osd_StatesFree( osd_menu_t *p_menu, osd_state_t *p_states ) { if( p_state->p_next->p_pic ) { - if( p_state->p_next->p_pic->p_data_orig ) - free( p_state->p_next->p_pic->p_data_orig ); + free( p_state->p_next->p_pic->p_data_orig ); free( p_state->p_next->p_pic ); } - if( p_state->p_next->psz_state ) - free( p_state->p_next->psz_state ); + free( p_state->p_next->psz_state ); free( p_state->p_next ); p_state->p_next = NULL; } @@ -285,11 +279,10 @@ void osd_StatesFree( osd_menu_t *p_menu, osd_state_t *p_states ) p_state->psz_state, p_states ); if( p_states->p_pic ) { - if( p_states->p_pic->p_data_orig ) - free( p_states->p_pic->p_data_orig ); + free( p_states->p_pic->p_data_orig ); free( p_states->p_pic ); } - if( p_state->psz_state ) free( p_state->psz_state ); + free( p_state->psz_state ); free( p_states ); p_states = NULL; } diff --git a/modules/misc/osd/simple.c b/modules/misc/osd/simple.c index 88c66336e1..0523b75b43 100644 --- a/modules/misc/osd/simple.c +++ b/modules/misc/osd/simple.c @@ -236,7 +236,7 @@ int osd_parser_simpleOpen( vlc_object_t *p_this ) msg_Dbg( p_this, " + (menu up) hotkey down %s, file=%s%s", &action[0], p_menu->psz_path, &file[0] ); - if( p_up->psz_action_down ) free( p_up->psz_action_down ); + free( p_up->psz_action_down ); p_up->psz_action_down = strdup( &action[0] ); /* Parse range contstruction : @@ -335,8 +335,7 @@ int osd_parser_simpleOpen( vlc_object_t *p_this ) msg_Dbg( p_this, " + hotkey down %s, file=%s%s", &action[0], p_menu->psz_path, &file[0] ); - if( p_current->psz_action_down ) - free( p_current->psz_action_down ); + free( p_current->psz_action_down ); p_current->psz_action_down = strdup( &action[0] ); /* Parse range contstruction : diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c index 551f5a8da5..34b7f51318 100644 --- a/modules/misc/quartztext.c +++ b/modules/misc/quartztext.c @@ -183,8 +183,7 @@ static void Destroy( vlc_object_t *p_this ) free( p_sys->p_fonts ); } - if( p_sys->psz_font_name ) free( p_sys->psz_font_name ); - + free( p_sys->psz_font_name ); free( p_sys ); } @@ -598,7 +597,7 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader, { if( !strcasecmp( "face", psz_name ) ) { - if( psz_fontname ) free( psz_fontname ); + free( psz_fontname ); psz_fontname = strdup( psz_value ); } else if( !strcasecmp( "size", psz_name ) ) diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c index 0b3f54ab0b..9f28f013b1 100644 --- a/modules/misc/rtsp.c +++ b/modules/misc/rtsp.c @@ -257,7 +257,7 @@ static int Open( vlc_object_t *p_this ) psz_url = config_GetPsz( p_vod, "rtsp-host" ); vlc_UrlParse( &url, psz_url, 0 ); - if( psz_url ) free( psz_url ); + free( psz_url ); if( url.i_port <= 0 ) url.i_port = 554; @@ -310,9 +310,12 @@ static int Open( vlc_object_t *p_this ) return VLC_SUCCESS; error: - if( p_sys && p_sys->p_rtsp_host ) httpd_HostDelete( p_sys->p_rtsp_host ); - if( p_sys && p_sys->psz_raw_mux ) free( p_sys->psz_raw_mux ); - if( p_sys ) free( p_sys ); + if( p_sys ) + { + if( p_sys->p_rtsp_host ) httpd_HostDelete( p_sys->p_rtsp_host ); + free( p_sys->psz_raw_mux ); + free( p_sys ); + } vlc_UrlClean( &url ); return VLC_EGENERIC; @@ -459,9 +462,9 @@ static void MediaDel( vod_t *p_vod, vod_media_t *p_media ) TAB_CLEAN( p_media->i_rtsp, p_media->rtsp ); httpd_UrlDelete( p_media->p_rtsp_url ); - if( p_media->psz_rtsp_path ) free( p_media->psz_rtsp_path ); - if( p_media->psz_rtsp_control_v6 ) free( p_media->psz_rtsp_control_v6 ); - if( p_media->psz_rtsp_control_v4 ) free( p_media->psz_rtsp_control_v4 ); + free( p_media->psz_rtsp_path ); + free( p_media->psz_rtsp_control_v6 ); + free( p_media->psz_rtsp_control_v4 ); while( p_media->i_es ) MediaDelES( p_vod, p_media, &p_media->es[0]->fmt ); @@ -469,12 +472,11 @@ static void MediaDel( vod_t *p_vod, vod_media_t *p_media ) vlc_mutex_destroy( &p_media->lock ); - if( p_media->psz_session_name ) free( p_media->psz_session_name ); - if( p_media->psz_session_description ) - free( p_media->psz_session_description ); - if( p_media->psz_session_url ) free( p_media->psz_session_url ); - if( p_media->psz_session_email ) free( p_media->psz_session_email ); - if( p_media->psz_mux ) free( p_media->psz_mux ); + free( p_media->psz_session_name ); + free( p_media->psz_session_description ); + free( p_media->psz_session_url ); + free( p_media->psz_session_email ); + free( p_media->psz_mux ); free( p_media ); } @@ -486,7 +488,7 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) if( !p_es ) return VLC_ENOMEM; memset( p_es, 0, sizeof(media_es_t) ); - if( p_media->psz_mux ) free( p_media->psz_mux ); + free( p_media->psz_mux ); p_media->psz_mux = NULL; /* TODO: update SDP, etc... */ @@ -587,10 +589,8 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) "sprop-parameter-sets=%s,%s;", hexa, p_64_sps, p_64_pps ) < 0 ) return VLC_ENOMEM; - if( p_64_sps ) - free( p_64_sps ); - if( p_64_pps ) - free( p_64_pps ); + free( p_64_sps ); + free( p_64_pps ); } if( !p_es->psz_fmtp ) p_es->psz_fmtp = strdup( "packetization-mode=1" ); @@ -740,8 +740,8 @@ static void MediaDelES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt) TAB_REMOVE( p_media->i_es, p_media->es, p_es ); vlc_mutex_unlock( &p_media->lock ); - if( p_es->psz_rtpmap ) free( p_es->psz_rtpmap ); - if( p_es->psz_fmtp ) free( p_es->psz_fmtp ); + free( p_es->psz_rtpmap ); + free( p_es->psz_fmtp ); p_media->i_sdp_version++; if( p_es->p_rtsp_url ) httpd_UrlDelete( p_es->p_rtsp_url ); @@ -850,10 +850,8 @@ static void CommandThread( vlc_object_t *p_this ) next: vlc_mutex_unlock( &p_sys->lock_media ); - if( cmd.psz_session ) - free( cmd.psz_session ); - if( cmd.psz_arg ) - free( cmd.psz_arg ); + free( cmd.psz_session ); + free( cmd.psz_arg ); } } @@ -899,8 +897,7 @@ static void RtspClientDel( vod_media_t *p_media, rtsp_client_t *p_rtsp ) while( p_rtsp->i_es-- ) { - if( p_rtsp->es[p_rtsp->i_es]->psz_ip ) - free( p_rtsp->es[p_rtsp->i_es]->psz_ip ); + free( p_rtsp->es[p_rtsp->i_es]->psz_ip ); free( p_rtsp->es[p_rtsp->i_es] ); if( !p_rtsp->i_es ) free( p_rtsp->es ); } @@ -958,7 +955,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl, if( strstr( psz_transport, "MP2T/H2221/UDP" ) || strstr( psz_transport, "RAW/RAW/UDP" ) ) { - if( p_media->psz_mux ) free( p_media->psz_mux ); + free( p_media->psz_mux ); p_media->psz_mux = NULL; p_media->psz_mux = strdup( p_vod->p_sys->psz_raw_mux ); p_media->b_raw = VLC_TRUE; @@ -1454,7 +1451,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl, { if( p_rtsp->es[i]->p_media_es == p_es ) { - if( p_rtsp->es[i]->psz_ip ) free( p_rtsp->es[i]->psz_ip ); + free( p_rtsp->es[i]->psz_ip ); TAB_REMOVE( p_rtsp->i_es, p_rtsp->es, p_rtsp->es[i] ); break; } diff --git a/modules/misc/win32text.c b/modules/misc/win32text.c index 7c35f9361c..0541e01d8c 100644 --- a/modules/misc/win32text.c +++ b/modules/misc/win32text.c @@ -183,13 +183,13 @@ static int Create( vlc_object_t *p_this ) p_sys->i_default_font_size = val.i_int; if( SetFont( p_filter, 0 ) != VLC_SUCCESS ) goto error; - if( psz_fontfile ) free( psz_fontfile ); + free( psz_fontfile ); p_filter->pf_render_text = RenderText; p_filter->pf_render_html = NULL; return VLC_SUCCESS; error: - if( psz_fontfile ) free( psz_fontfile ); + free( psz_fontfile ); free( p_sys ); return VLC_EGENERIC; } diff --git a/modules/misc/xml/xtag.c b/modules/misc/xml/xtag.c index 33021b6c89..7cab50b62a 100644 --- a/modules/misc/xml/xtag.c +++ b/modules/misc/xml/xtag.c @@ -185,7 +185,8 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *s ) i_pos += i_size; i_buffer += i_size; p_new = realloc( p_buffer, i_buffer ); - if (!p_new) { + if( !p_new ) + { msg_Err( p_xml, "out of memory" ); free( p_buffer ); return NULL; @@ -744,15 +745,15 @@ static XTag *xtag_free( XTag *xtag ) if( xtag == NULL ) return NULL; - if( xtag->name ) free( xtag->name ); - if( xtag->pcdata ) free( xtag->pcdata ); + free( xtag->name ); + free( xtag->pcdata ); for( l = xtag->attributes; l; l = l->next ) { if( (attr = (XAttribute *)l->data) != NULL ) { - if( attr->name ) free( attr->name ); - if( attr->value ) free( attr->value ); + free( attr->name ); + free( attr->value ); free( attr ); } } diff --git a/modules/visualization/galaktos/plugin.c b/modules/visualization/galaktos/plugin.c index c9672b83bc..7e1db91c75 100644 --- a/modules/visualization/galaktos/plugin.c +++ b/modules/visualization/galaktos/plugin.c @@ -123,7 +123,7 @@ static int Open( vlc_object_t *p_this ) VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) ) { msg_Err( p_filter, "cannot lauch galaktos thread" ); - if( p_thread->psz_title ) free( p_thread->psz_title ); + free( p_thread->psz_title ); vlc_object_detach( p_thread ); vlc_object_release( p_thread ); free( p_sys ); @@ -247,11 +247,8 @@ static void Thread( vlc_object_t *p_this ) { vlc_object_kill( p_thread ); } - if( p_thread->psz_title ) - { - free( p_thread->psz_title ); - p_thread->psz_title = NULL; - } + free( p_thread->psz_title ); + p_thread->psz_title = NULL; if (++count%100==0) { diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c index 3148584aa9..658d688011 100644 --- a/modules/visualization/goom.c +++ b/modules/visualization/goom.c @@ -198,7 +198,7 @@ static int Open( vlc_object_t *p_this ) vout_Destroy( p_thread->p_vout ); vlc_mutex_destroy( &p_thread->lock ); vlc_cond_destroy( &p_thread->wait ); - if( p_thread->psz_title ) free( p_thread->psz_title ); + free( p_thread->psz_title ); vlc_object_detach( p_thread ); vlc_object_release( p_thread ); free( p_sys ); @@ -354,11 +354,8 @@ static void Thread( vlc_object_t *p_this ) plane = goom_update( p_plugin_info, p_data, 0, 0.0, p_thread->psz_title, NULL ); - if( p_thread->psz_title ) - { - free( p_thread->psz_title ); - p_thread->psz_title = NULL; - } + free( p_thread->psz_title ); + p_thread->psz_title = NULL; while( !( p_pic = vout_CreatePicture( p_thread->p_vout, 0, 0, 0 ) ) && !p_thread->b_die ) diff --git a/modules/visualization/visual/effects.c b/modules/visualization/visual/effects.c index 058d32ce1a..5585d7d0c5 100644 --- a/modules/visualization/visual/effects.c +++ b/modules/visualization/visual/effects.c @@ -310,15 +310,11 @@ int spectrum_Run(visual_effect_t * p_effect, aout_instance_t *p_aout, fft_close( p_state ); - if( p_s16_buff != NULL ) - { - free( p_s16_buff ); - p_s16_buff = NULL; - } - - if(height) free(height); + free( p_s16_buff ); + p_s16_buff = NULL; - if(psz_parse) free(psz_parse); + free( height ); + free( psz_parse ); return 0; } @@ -768,15 +764,11 @@ int spectrometer_Run(visual_effect_t * p_effect, aout_instance_t *p_aout, fft_close( p_state ); - if( p_s16_buff != NULL ) - { - free( p_s16_buff ); - p_s16_buff = NULL; - } - - if(height) free(height); + free( p_s16_buff ); + p_s16_buff = NULL; - if(psz_parse) free(psz_parse); + free( height ); + free( psz_parse ); return 0; } diff --git a/modules/visualization/visual/fft.c b/modules/visualization/visual/fft.c index fa66396565..82bd591bb1 100644 --- a/modules/visualization/visual/fft.c +++ b/modules/visualization/visual/fft.c @@ -109,7 +109,7 @@ void fft_perform(const sound_sample *input, float *output, fft_state *state) { * Free the state. */ void fft_close(fft_state *state) { - if(state) free(state); + free( state ); } /***************************************************************************** -- 2.39.2