diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-08-30 08:52:06 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-09-01 13:07:39 -0400 | 
| commit | a556f6e38b404ae1b90a52b23e5afacd64ab4d45 (patch) | |
| tree | 6784ce61afd4cf8c4091e1d58dcebd60c12c3b8a | |
| parent | 3bf359b04eb214fcc88df37a855d6abde5b07271 (diff) | |
isisd: in isis_mt.c use appropriate memory allocator
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| -rw-r--r-- | isisd/isis_mt.c | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/isisd/isis_mt.c b/isisd/isis_mt.c index d04a24dc46..65ba395ffc 100644 --- a/isisd/isis_mt.c +++ b/isisd/isis_mt.c @@ -226,7 +226,8 @@ struct isis_area_mt_setting **area_mt_settings(struct isis_area *area,  		count++;  		if (count > size) { -			rv = XREALLOC(MTYPE_TMP, rv, count * sizeof(*rv)); +			rv = XREALLOC(MTYPE_MT_AREA_SETTING, rv, +				      count * sizeof(*rv));  			size = count;  		}  		rv[count - 1] = setting; @@ -341,7 +342,8 @@ circuit_mt_settings(struct isis_circuit *circuit, unsigned int *mt_count)  		count++;  		if (count > size) { -			rv = XREALLOC(MTYPE_TMP, rv, count * sizeof(*rv)); +			rv = XREALLOC(MTYPE_MT_AREA_SETTING, rv, +				      count * sizeof(*rv));  			size = count;  		}  		rv[count - 1] = setting; @@ -376,8 +378,8 @@ bool tlvs_to_adj_mt_set(struct isis_tlvs *tlvs, bool v4_usable, bool v6_usable,  	old_mt_count = adj->mt_count;  	if (old_mt_count) { -		old_mt_set = -			XCALLOC(MTYPE_TMP, old_mt_count * sizeof(*old_mt_set)); +		old_mt_set = XCALLOC(MTYPE_MT_AREA_SETTING, +				     old_mt_count * sizeof(*old_mt_set));  		memcpy(old_mt_set, adj->mt_set,  		       old_mt_count * sizeof(*old_mt_set));  	} @@ -436,7 +438,7 @@ bool tlvs_to_adj_mt_set(struct isis_tlvs *tlvs, bool v4_usable, bool v6_usable,  		changed = true;  	if (old_mt_count) -		XFREE(MTYPE_TMP, old_mt_set); +		XFREE(MTYPE_MT_AREA_SETTING, old_mt_set);  	return changed;  } @@ -464,7 +466,7 @@ static void mt_set_add(uint16_t **mt_set, unsigned int *size,  	}  	if (*index >= *size) { -		*mt_set = XREALLOC(MTYPE_TMP, *mt_set, +		*mt_set = XREALLOC(MTYPE_MT_AREA_SETTING, *mt_set,  				   sizeof(**mt_set) * ((*index) + 1));  		*size = (*index) + 1;  	}  | 
