]> git.sesse.net Git - vlc/commitdiff
Remove unneeded msg_Error about memory failure.
authorRémi Duraffort <ivoire@videolan.org>
Sat, 21 Jun 2008 14:03:19 +0000 (16:03 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Sun, 22 Jun 2008 19:41:15 +0000 (21:41 +0200)
Fix a double malloc.
Fix potential segfault.

21 files changed:
modules/access/cdda/access.c
modules/access/dc1394.c
modules/access/http.c
modules/access/rtmp/access.c
modules/access/v4l2/v4l2.c
modules/access/vcd/cdrom.c
modules/audio_filter/channel_mixer/dolby.c
modules/audio_filter/channel_mixer/headphone.c
modules/audio_filter/channel_mixer/mono.c
modules/audio_filter/converter/a52tofloat32.c
modules/audio_filter/converter/dtstofloat32.c
modules/audio_filter/converter/dtstospdif.c
modules/audio_filter/converter/mpgatofixed32.c
modules/audio_filter/resampler/bandlimited.c
modules/audio_filter/resampler/linear.c
modules/misc/freetype.c
modules/misc/logger.c
modules/misc/quartztext.c
modules/misc/rtsp.c
modules/misc/xml/xtag.c
modules/stream_out/transcode.c

index d399ab9a81c1945a975645e4b52d361a9ce54d79..bd33fb86803f25cac1271a36727634334faa0d99 100644 (file)
@@ -634,7 +634,6 @@ int CDDAOpen( vlc_object_t *p_this )
     p_cdda = calloc( 1, sizeof(cdda_data_t) );
     if( p_cdda == NULL )
     {
-        msg_Err( p_access, "out of memory" );
         free( psz_source );
         return VLC_ENOMEM;
     }
index 34cd3aa42ab4dcc7135cf4dcdb9a763e9cead2bf..381e14a73050a0d080798d276b1164ad543e170a 100644 (file)
@@ -227,10 +227,7 @@ static int Open( vlc_object_t *p_this )
 
     p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
     if( !p_sys )
-    {
-        msg_Err( p_demux, "not enough memory available" );
         return VLC_ENOMEM;
-    }
     memset( p_sys, 0, sizeof( demux_sys_t ) );
     memset( &fmt, 0, sizeof( es_format_t ) );
 
index 57e4b2e7653be92acc6045c15e168b62ff4d3b83..87bd3a183544f14fd425e67c91df29195fec6bbd 100644 (file)
@@ -339,7 +339,7 @@ static int OpenWithCookies( vlc_object_t *p_this, vlc_array_t *cookies )
                 if (proxies[0])
                 {
                     msg_Dbg(p_access, "libproxy suggest to use '%s'", proxies[0]);
-                    if(strcmp(proxies[0],"direct://") != 0) 
+                    if(strcmp(proxies[0],"direct://") != 0)
                     {
                         p_sys->b_proxy = true;
                         vlc_UrlParse( &p_sys->proxy, proxies[0], 0);
index 41f77768768e077ff8d476d412987bd9581eae55..8be1e0d27c3ce59423eba7792636e545c037fe99 100644 (file)
@@ -88,10 +88,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_thread =
         vlc_object_create( p_access, sizeof( rtmp_control_thread_t ) );
     if( !p_sys->p_thread )
-    {
-        msg_Err( p_access, "out of memory" );
         return VLC_ENOMEM;
-    }
     vlc_object_attach( p_sys->p_thread, p_access );
 
     /* Parse URI - remove spaces */
index 11374d8f9fd8da369079ef0e6eaf74594a805085..1bc4f35a59b9b1442ee402ca1a0c281f63d052d0 100644 (file)
@@ -1662,18 +1662,12 @@ static int InitRead( demux_t *p_demux, int i_fd, unsigned int i_buffer_size )
 
     p_sys->p_buffers = calloc( 1, sizeof( *p_sys->p_buffers ) );
     if( !p_sys->p_buffers )
-    {
-        msg_Err( p_demux, "Out of memory" );
         goto open_failed;
-    }
 
     p_sys->p_buffers[0].length = i_buffer_size;
     p_sys->p_buffers[0].start = malloc( i_buffer_size );
     if( !p_sys->p_buffers[0].start )
-    {
-        msg_Err( p_demux, "Out of memory" );
         goto open_failed;
-    }
 
     return VLC_SUCCESS;
 
index 8c03ccb6403d946d2c034b5d949f5b72535e599e..ddf5e3955543312f7ed71ad08743679b0dfe15d2 100644 (file)
@@ -96,10 +96,7 @@ vcddev_t *ioctl_Open( vlc_object_t *p_this, const char *psz_dev )
      */
     p_vcddev = (vcddev_t *)malloc( sizeof(vcddev_t) );
     if( p_vcddev == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return NULL;
-    }
     p_vcddev->i_vcdimage_handle = -1;
     p_vcddev->psz_dev = NULL;
     b_is_file = 1;
@@ -211,10 +208,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
         {
             *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) );
             if( *pp_sectors == NULL )
-            {
-                msg_Err( p_this, "out of memory" );
                 return 0;
-            }
             memcpy( *pp_sectors, p_vcddev->p_sectors,
                     (i_tracks + 1) * sizeof(int) );
         }
@@ -251,7 +245,6 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
             *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) );
             if( *pp_sectors == NULL )
             {
-                msg_Err( p_this, "out of memory" );
                 darwin_freeTOC( pTOC );
                 return 0;
             }
@@ -360,7 +353,6 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
                 {
                     free( *pp_sectors );
                     free( p_fulltoc );
-                    msg_Err( p_this, "out of memory" );
                     CloseHandle( hEvent );
                     return 0;
                 }
@@ -423,10 +415,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
 
                 *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) );
                 if( *pp_sectors == NULL )
-                {
-                    msg_Err( p_this, "out of memory" );
                     return 0;
-                }
 
                 for( i = 0 ; i <= i_tracks ; i++ )
                 {
@@ -459,10 +448,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
 
              *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) );
              if( *pp_sectors == NULL )
-             {
-                 msg_Err( p_this, "out of memory" );
                  return 0;
-             }
 
              toc_entries.address_format = CD_LBA_FORMAT;
              toc_entries.starting_track = 0;
@@ -472,7 +458,6 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
                                     malloc( toc_entries.data_len );
              if( toc_entries.data == NULL )
              {
-                 msg_Err( p_this, "out of memory" );
                  free( *pp_sectors );
                  return 0;
              }
@@ -518,10 +503,7 @@ int ioctl_GetTracksMap( vlc_object_t *p_this, const vcddev_t *p_vcddev,
 
             *pp_sectors = malloc( (i_tracks + 1) * sizeof(int) );
             if( *pp_sectors == NULL )
-            {
-                msg_Err( p_this, "out of memory" );
                 return 0;
-            }
 
             /* Fill the p_sectors structure with the track/sector matches */
             for( i = 0 ; i <= i_tracks ; i++ )
index 032da2aa8d850353a949b4321be45d499d55d7f6..0cfb7c0403c86e438e5481f4131aab81004c2b3c 100644 (file)
@@ -106,10 +106,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
     if ( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     p_filter->p_sys->i_left = -1;
     p_filter->p_sys->i_center = -1;
     p_filter->p_sys->i_right = -1;
index 668cd8cd01850d015e34c96a3a8392d5ba13185b..4f903e8fbb1ba0af986853d294d2d01f354222a4 100644 (file)
@@ -245,10 +245,7 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
     p_data->p_atomic_operations = malloc( sizeof(struct atomic_operation_t)
             * p_data->i_nb_atomic_operations );
     if( p_data->p_atomic_operations == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return -1;
-    }
 
     /* For each virtual speaker, computes elementary wave propagation time
      * to each ear */
@@ -346,10 +343,7 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
     }
     p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size );
     if( p_data->p_atomic_operations == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return -1;
-    }
     memset( p_data->p_overflow_buffer, 0 , p_data->i_overflow_buffer_size );
 
     /* end */
@@ -411,10 +405,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     p_filter->p_sys->i_overflow_buffer_size = 0;
     p_filter->p_sys->p_overflow_buffer = NULL;
     p_filter->p_sys->i_nb_atomic_operations = 0;
@@ -626,10 +617,7 @@ static int OpenFilter( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = malloc( sizeof(struct filter_sys_t) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
     p_filter->p_sys->i_overflow_buffer_size = 0;
     p_filter->p_sys->p_overflow_buffer = NULL;
     p_filter->p_sys->i_nb_atomic_operations = 0;
index 5c1a293512fd9eed91cd9f03dc6ff79ad7d09eb8..a6633249bee976d0e808d40edc33df988cae7597 100644 (file)
@@ -247,10 +247,7 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data,
     p_data->p_atomic_operations = malloc( sizeof(struct atomic_operation_t)
             * p_data->i_nb_atomic_operations );
     if( p_data->p_atomic_operations == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return -1;
-    }
 
     /* For each virtual speaker, computes elementary wave propagation time
      * to each ear */
@@ -348,10 +345,7 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data,
     }
     p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size );
     if( p_data->p_atomic_operations == NULL )
-    {
-        msg_Err( p_this, "out of memory" );
         return -1;
-    }
     memset( p_data->p_overflow_buffer, 0, p_data->i_overflow_buffer_size );
 
     /* end */
@@ -393,10 +387,7 @@ static int OpenFilter( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_EGENERIC;
-    }
 
     var_Create( p_this, MONO_CFG "downmix",
                 VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
index 5f6024cd80710b77e29f8f777951205711e9a3d7..895d7d83181400b00b6d40624a8552bd106812e6 100644 (file)
@@ -149,10 +149,7 @@ static int Create( vlc_object_t *p_this )
     p_sys = malloc( sizeof(filter_sys_t) );
     p_filter->p_sys = (struct aout_filter_sys_t *)p_sys;
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return -1;
-    }
 
     i_ret = Open( VLC_OBJECT(p_filter), p_sys,
                   p_filter->input, p_filter->output );
@@ -444,10 +441,7 @@ static int OpenFilter( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = p_sys = malloc( sizeof(filter_sys_t) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
 
     i_ret = Open( VLC_OBJECT(p_filter), p_sys,
                   p_filter->fmt_in.audio, p_filter->fmt_out.audio );
index 12f94a57a5922151047b328330d87179228a21a0..cc103e65b506171d470718b6e82f93cc50fccbd8 100644 (file)
@@ -128,10 +128,7 @@ static int Create( vlc_object_t *p_this )
     p_sys = malloc( sizeof(filter_sys_t) );
     p_filter->p_sys = (struct aout_filter_sys_t *)p_sys;
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return -1;
-    }
 
     i_ret = Open( VLC_OBJECT(p_filter), p_sys,
                   p_filter->input, p_filter->output );
@@ -402,18 +399,7 @@ static int OpenFilter( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
-
-    /* Allocate the memory needed to store the module's structure */
-    p_filter->p_sys = p_sys = malloc( sizeof(filter_sys_t) );
-    if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
 
     i_ret = Open( VLC_OBJECT(p_filter), p_sys,
                   p_filter->fmt_in.audio, p_filter->fmt_out.audio );
index ea0cba3c7000ea94fe69d4590dfadb6cb256c2f3..cfe4260aabf5c0947b29350c2eda1946a34321de 100644 (file)
@@ -91,10 +91,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     memset( p_filter->p_sys, 0, sizeof(struct aout_filter_sys_t) );
     p_filter->p_sys->p_buf = 0;
 
index 67ae4f8a53701a082d308de76b58c02b420ad9ad..1e2a773095a2c300ff880f5b5a2d8d7f01f5fb9b 100644 (file)
@@ -104,10 +104,7 @@ static int Create( vlc_object_t *p_this )
     p_sys = malloc( sizeof(filter_sys_t) );
     p_filter->p_sys = (struct aout_filter_sys_t *)p_sys;
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return -1;
-    }
 
     /* Initialize libmad */
     mad_stream_init( &p_sys->mad_stream );
@@ -316,10 +313,7 @@ static int OpenFilter( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return -1;
-    }
     p_sys->i_reject_count = 0;
 
     p_filter->pf_audio_filter = Convert;
index f30748693d7702ea88369f4d227eb0cb2f7b3b3b..a9c1bedd3d228968d9714a40fe7e5e5979fb1695 100644 (file)
@@ -119,10 +119,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     /* Calculate worst case for the length of the filter wing */
     d_factor = (double)p_filter->output.i_rate
@@ -135,10 +132,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate enough memory to buffer previous samples */
     p_filter->p_sys->p_buf = malloc( p_filter->p_sys->i_buf_size );
     if( p_filter->p_sys->p_buf == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     p_filter->p_sys->i_old_wing = 0;
     p_filter->pf_do_work = DoWork;
index 2a51cd2e5833ad1d1fccf2c585b8c95fda6db4d3..badd99eafbbcf53a769fa24116e29083582f2ec9 100644 (file)
@@ -99,17 +99,11 @@ static int Create( vlc_object_t *p_this )
     p_sys = malloc( sizeof(filter_sys_t) );
     p_filter->p_sys = (struct aout_filter_sys_t *)p_sys;
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     p_sys->p_prev_sample = malloc(
         p_filter->input.i_channels * sizeof(int32_t) );
     if( p_sys->p_prev_sample == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     aout_DateInit( &p_sys->end_date, p_filter->output.i_rate );
 
     p_filter->pf_do_work = DoWork;
@@ -275,16 +269,12 @@ static int OpenFilter( vlc_object_t *p_this )
     /* Allocate the memory needed to store the module's structure */
     p_filter->p_sys = p_sys = malloc( sizeof(struct filter_sys_t) );
     if( p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     p_sys->p_prev_sample = malloc(
         p_filter->fmt_in.audio.i_channels * sizeof(int32_t) );
     if( p_sys->p_prev_sample == NULL )
     {
-        msg_Err( p_filter, "out of memory" );
         free( p_sys );
         return VLC_ENOMEM;
     }
index 1f5850c4d67599b85e74b7b015d5913196fc47ce..35a646122da3b550d236c60b8dba9140ddac66a6 100644 (file)
@@ -289,10 +289,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate structure */
     p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
     if( !p_sys )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     p_sys->p_face = 0;
     p_sys->p_library = 0;
     p_sys->i_font_size = 0;
@@ -324,10 +321,7 @@ static int Create( vlc_object_t *p_this )
         free( psz_fontfile );
         psz_fontfile = (char *)malloc( PATH_MAX + 1 );
         if( !psz_fontfile )
-        {
-            msg_Err( p_filter, "out of memory" );
             goto error;
-        }
 #ifdef WIN32
         GetWindowsDirectory( psz_fontfile, PATH_MAX + 1 );
         strcat( psz_fontfile, "\\fonts\\arial.ttf" );
@@ -1128,10 +1122,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
     psz_unicode = psz_unicode_orig =
         malloc( ( strlen(psz_string) + 1 ) * sizeof(uint32_t) );
     if( psz_unicode == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         goto error;
-    }
 #if defined(WORDS_BIGENDIAN)
     iconv_handle = vlc_iconv_open( "UCS-4BE", "UTF-8" );
 #else
@@ -1174,10 +1165,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 
         p_fribidi_string = malloc( (i_string_length + 1) * sizeof(uint32_t) );
         if( !p_fribidi_string )
-        {
-            msg_Err( p_filter, "out of memory" );
             goto error;
-        }
 
         /* Do bidi conversion line-by-line */
         while( pos < i_string_length )
@@ -1218,10 +1206,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
     /* Calculate relative glyph positions and a bounding box for the
      * entire string */
     if( !(p_line = NewLine( strlen( psz_string ))) )
-    {
-        msg_Err( p_filter, "out of memory" );
         goto error;
-    }
     p_lines = p_line;
     i_pen_x = i_pen_y = 0;
     i_previous = i = 0;
@@ -1242,10 +1227,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
         {
             psz_line_start = psz_unicode;
             if( !(p_next = NewLine( strlen( psz_string ))) )
-            {
-                msg_Err( p_filter, "out of memory" );
                 goto error;
-            }
             p_line->p_next = p_next;
             p_line->i_width = line.xMax;
             p_line->i_height = face->size->metrics.height >> 6;
@@ -2285,7 +2267,6 @@ static int ProcessLines( filter_t *p_filter,
             ! p_new_positions ||
             ! p_levels )
         {
-            msg_Err( p_filter, "out of memory" );
             free( p_levels );
             free( p_old_positions );
             free( p_new_positions );
@@ -2500,7 +2481,6 @@ static int ProcessLines( filter_t *p_filter,
                               malloc( (k - i_prev + 1) * sizeof( uint32_t ));
             if( !psz_unicode )
             {
-                msg_Err( p_filter, "out of memory" );
                 if( p_face ) FT_Done_Face( p_face );
                 free( pp_char_styles );
                 free( psz_unicode );
@@ -2519,7 +2499,6 @@ static int ProcessLines( filter_t *p_filter,
                 {
                     if( !(p_line = NewLine( i_len - i_prev)) )
                     {
-                        msg_Err( p_filter, "out of memory" );
                         if( p_face ) FT_Done_Face( p_face );
                         free( pp_char_styles );
                         free( psz_unicode );
index 36a320d07712f29cd5fced6a9bd55d9113d36280..360a04e2f57ce24fa8184a6d0b09daa02306ad7c 100644 (file)
@@ -167,10 +167,7 @@ static int Open( vlc_object_t *p_this )
     /* Allocate instance and initialize some members */
     p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
     if( p_intf->p_sys == NULL )
-    {
-        msg_Err( p_intf, "out of memory" );
         return -1;
-    }
 
     psz_mode = var_CreateGetString( p_intf, "logmode" );
     if( psz_mode )
index ae299ca157e501336fa8a4c7bd52554ca776145d..ba78fef11660e126f0d2306a5fb3a28e205ad6d3 100644 (file)
@@ -142,10 +142,7 @@ static int Create( vlc_object_t *p_this )
     // Allocate structure
     p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
     if( !p_sys )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     p_sys->psz_font_name  = strdup( DEFAULT_FONT );
     p_sys->i_font_opacity = 255;
     p_sys->i_font_color   = DEFAULT_FONT_COLOR;
index 450551d9ef8171f1ff1c5d2cb795531570c04be0..c162b1877bf0bab5c3d13e3573cc57584771bdb3 100644 (file)
@@ -365,10 +365,7 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
     int i;
 
     if( !p_media )
-    {
-        msg_Err( p_vod, "not enough memory" );
         return NULL;
-    }
 
     memset( p_media, 0, sizeof(vod_media_t) );
     p_media->id = p_sys->i_media_id++;
index e3b5193cbaccf77290a866a461aac03293dc28d5..b5eb64bcc7c404bb4ff4dedf02894d04e35d9224 100644 (file)
@@ -178,10 +178,8 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *s )
 
     /* Open and read file */
     p_buffer = malloc( i_buffer );
-    if( p_buffer == NULL ) {
-        msg_Err( p_xml, "out of memory" );
+    if( p_buffer == NULL )
         return NULL;
-    }
 
     while( ( i_size = stream_Read( s, &p_buffer[i_pos], 2048 ) ) == 2048 )
     {
@@ -190,7 +188,6 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *s )
         p_new = realloc( p_buffer, i_buffer );
         if( !p_new )
         {
-            msg_Err( p_xml, "out of memory" );
             free( p_buffer );
             return NULL;
         }
index af0c0c92a7b97a336cef286e0a74f83d4371c098..d18f71bc9d9fe9989c1114d3e8a4f19d86dac547 100644 (file)
@@ -739,10 +739,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
 
     id = malloc( sizeof( sout_stream_id_t ) );
     if( !id )
-    {
-        msg_Err( p_stream, "out of memory" );
         goto error;
-    }
     memset( id, 0, sizeof(sout_stream_id_t) );
 
     id->id = NULL;
@@ -752,10 +749,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
     /* Create decoder object */
     id->p_decoder = vlc_object_create( p_stream, VLC_OBJECT_DECODER );
     if( !id->p_decoder )
-    {
-        msg_Err( p_stream, "out of memory" );
         goto error;
-    }
     vlc_object_attach( id->p_decoder, p_stream );
     id->p_decoder->p_module = NULL;
     id->p_decoder->fmt_in = *p_fmt;
@@ -764,10 +758,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
     /* Create encoder object */
     id->p_encoder = vlc_object_create( p_stream, VLC_OBJECT_ENCODER );
     if( !id->p_encoder )
-    {
-        msg_Err( p_stream, "out of memory" );
         goto error;
-    }
     vlc_object_attach( id->p_encoder, p_stream );
     id->p_encoder->p_module = NULL;
 
@@ -931,23 +922,26 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
 
     return id;
 
- error:
-    if( id->p_decoder )
+error:
+    if( id )
     {
-        vlc_object_detach( id->p_decoder );
-        vlc_object_release( id->p_decoder );
-        id->p_decoder = NULL;
-    }
+        if( id->p_decoder )
+        {
+            vlc_object_detach( id->p_decoder );
+            vlc_object_release( id->p_decoder );
+            id->p_decoder = NULL;
+        }
 
-    if( id->p_encoder )
-    {
-        vlc_object_detach( id->p_encoder );
-        es_format_Clean( &id->p_encoder->fmt_out );
-        vlc_object_release( id->p_encoder );
-        id->p_encoder = NULL;
-    }
+        if( id->p_encoder )
+        {
+            vlc_object_detach( id->p_encoder );
+            es_format_Clean( &id->p_encoder->fmt_out );
+            vlc_object_release( id->p_encoder );
+            id->p_encoder = NULL;
+        }
 
-    free( id );
+        free( id );
+    }
     return NULL;
 }