Skip to content

Commit

Permalink
Remove an unnecessary null check in mlt_pool. (SF-216)
Browse files Browse the repository at this point in the history
  • Loading branch information
elfring authored and ddennedy committed Oct 2, 2014
1 parent ee14445 commit 2e4a6c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 4 additions & 4 deletions coccinelle/delete_if4.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
expression x;
identifier release =~ "^(?x)
(?:cJSON_InitHooks
| free
| (?:mlt_)?free
| mlt_(?:(?:animation
| cache(?:_item)?
| profile
Expand All @@ -21,7 +21,7 @@ identifier release =~ "^(?x)
expression x;
identifier release =~ "^(?x)
(?:cJSON_InitHooks
| free
| (?:mlt_)?free
| mlt_(?:(?:animation
| cache(?:_item)?
| profile
Expand All @@ -42,7 +42,7 @@ identifier release =~ "^(?x)
expression a, b;
identifier release =~ "^(?x)
(?:cJSON_InitHooks
| free
| (?:mlt_)?free
| mlt_(?:(?:animation
| cache(?:_item)?
| profile
Expand All @@ -62,7 +62,7 @@ identifier release =~ "^(?x)
expression a, b;
identifier release =~ "^(?x)
(?:cJSON_InitHooks
| free
| (?:mlt_)?free
| mlt_(?:(?:animation
| cache(?:_item)?
| profile
Expand Down
7 changes: 1 addition & 6 deletions src/framework/mlt_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,9 @@ static void pool_return( void *ptr )
// Unlock the pool
pthread_mutex_unlock( &self->lock );

// Ensure that we don't clean up
ptr = NULL;
return;
}
}

// Tidy up - this will only occur if the returned item is incorrect
if ( ptr != NULL )
{
// Free the release itself
mlt_free( ( char * )ptr - sizeof( struct mlt_release_s ) );
}
Expand Down

0 comments on commit 2e4a6c1

Please sign in to comment.