summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRodeo <[email protected]>2014-01-07 11:41:35 +0000
committerRodeo <[email protected]>2014-01-07 11:41:35 +0000
commit5bf5ef4f102648396941e4a1d1ce4af36638d16b (patch)
tree5c6a30cf198e846c5893597e701417c74ea708af /test
parent78d3ce52294d199cbf6f45d2372c2622589efaa7 (diff)
parsecsv: always check result of malloc()
RebiewBoard #670. Patch by icchan. Thanks! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5957 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r--test/parsecsv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parsecsv.c b/test/parsecsv.c
index a1fdc360d..8e7bd08a8 100644
--- a/test/parsecsv.c
+++ b/test/parsecsv.c
@@ -54,6 +54,11 @@ hb_csv_file_t *hb_open_csv_file( const char *filepath )
}
file = malloc( sizeof( hb_csv_file_t ) );
+ if( file == NULL )
+ {
+ return file;
+ }
+
file->fileref = fileref;
file->eof = 0;
file->parse_state = CSV_PARSE_SEEK;
@@ -91,6 +96,11 @@ hb_csv_cell_t *hb_read_next_cell( hb_csv_file_t *file )
}
cell = malloc( sizeof( hb_csv_cell_t ) );
+ if( cell == NULL )
+ {
+ return cell;
+ }
+
cell->cell_row = file->curr_row;
cell->cell_col = file->curr_col;
index = 0;