File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -2873,9 +2873,9 @@ void apply_push_cas(struct push_cas_option *cas,
2873
2873
2874
2874
struct remote_state * remote_state_new (void )
2875
2875
{
2876
- struct remote_state * r = xmalloc ( sizeof ( * r )) ;
2876
+ struct remote_state * r ;
2877
2877
2878
- memset (r , 0 , sizeof ( * r ) );
2878
+ CALLOC_ARRAY (r , 1 );
2879
2879
2880
2880
hashmap_init (& r -> remotes_hash , remotes_hash_cmp , NULL , 0 );
2881
2881
hashmap_init (& r -> branches_hash , branches_hash_cmp , NULL , 0 );
Original file line number Diff line number Diff line change @@ -1490,14 +1490,13 @@ struct fetch_task {
1490
1490
*/
1491
1491
static const struct submodule * get_non_gitmodules_submodule (const char * path )
1492
1492
{
1493
- struct submodule * ret = NULL ;
1493
+ struct submodule * ret ;
1494
1494
const char * name = default_name_or_path (path );
1495
1495
1496
1496
if (!name )
1497
1497
return NULL ;
1498
1498
1499
- ret = xmalloc (sizeof (* ret ));
1500
- memset (ret , 0 , sizeof (* ret ));
1499
+ CALLOC_ARRAY (ret , 1 );
1501
1500
ret -> path = name ;
1502
1501
ret -> name = name ;
1503
1502
@@ -1537,8 +1536,9 @@ static struct fetch_task *fetch_task_create(struct submodule_parallel_fetch *spf
1537
1536
const char * path ,
1538
1537
const struct object_id * treeish_name )
1539
1538
{
1540
- struct fetch_task * task = xmalloc (sizeof (* task ));
1541
- memset (task , 0 , sizeof (* task ));
1539
+ struct fetch_task * task ;
1540
+
1541
+ CALLOC_ARRAY (task , 1 );
1542
1542
1543
1543
if (validate_submodule_path (path ) < 0 )
1544
1544
exit (128 );
You can’t perform that action at this time.
0 commit comments