Changeset 261fd89df68f7e4e1a5926c365d060033a5ec30a
- Timestamp:
- 05/10/08 20:01:11
(2 months ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1210442471 +0200
- git-parent:
[38aaaeb38781b5087e8bf645c6aaf19520745093]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1210441769 +0200
- Message:
Check malloc return value and cleanup if allocation failed.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r38aaaeb |
r261fd89 |
|
| 431 | 431 | |
|---|
| 432 | 432 | tmp_url = (char *) malloc( strlen( "rtmp://") + strlen( p_thread->url.psz_buffer ) + 1 ); |
|---|
| 433 | | /* FIXME: Handle error case when malloc FAILS */ |
|---|
| | 433 | if( !tmp_url ) |
|---|
| | 434 | { |
|---|
| | 435 | free( rtmp_body->body ); |
|---|
| | 436 | free( rtmp_body ); |
|---|
| | 437 | return -1; |
|---|
| | 438 | } |
|---|
| 434 | 439 | sprintf( tmp_url, "rtmp://%s", p_thread->url.psz_buffer ); |
|---|
| 435 | 440 | tmp_buffer = amf_encode_object_variable( "tcUrl", |
|---|
| … | … | |
| 1854 | 1859 | |
|---|
| 1855 | 1860 | description = (char *) malloc( strlen( "Playing and resetting ") + strlen( psz_media ) + strlen( "." ) + 1 ); |
|---|
| 1856 | | /* FIXME: Handle error case when malloc FAILS */ |
|---|
| 1857 | | |
|---|
| | 1861 | if( !description ) |
|---|
| | 1862 | { |
|---|
| | 1863 | free( rtmp_body->body ); |
|---|
| | 1864 | free( rtmp_body ); |
|---|
| | 1865 | return NULL; |
|---|
| | 1866 | } |
|---|
| 1858 | 1867 | sprintf( description, "Playing and resetting %s.", psz_media ); |
|---|
| 1859 | 1868 | tmp_buffer = amf_encode_object_variable( "description", |
|---|
| … | … | |
| 1936 | 1945 | |
|---|
| 1937 | 1946 | description = (char *) malloc( strlen( "Started playing ") + strlen( psz_media ) + strlen( "." ) + 1 ); |
|---|
| 1938 | | /* FIXME: Handle error case when MALLOC FAILS */ |
|---|
| | 1947 | if( !description ) |
|---|
| | 1948 | { |
|---|
| | 1949 | free( rtmp_body->body ); |
|---|
| | 1950 | free( rtmp_body ); |
|---|
| | 1951 | return NULL; |
|---|
| | 1952 | } |
|---|
| 1939 | 1953 | |
|---|
| 1940 | 1954 | sprintf( description, "Started playing %s.", psz_media ); |
|---|