Merge pull request #6529 from ton31337/fix/refcnt_check_for_dep_data_route-map

lib: Make sure route_map_dep_data is not NULL before decrementing refcount
This commit is contained in:
Russ White 2020-06-09 08:00:00 -04:00 committed by GitHub
commit 58ef49eb43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2747,7 +2747,12 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
memset(&tmp_dep_data, 0, sizeof(struct route_map_dep_data));
tmp_dep_data.rname = rname;
dep_data = hash_lookup(dep->dep_rmap_hash, &tmp_dep_data);
dep_data->refcnt--;
if (!dep_data)
goto out;
if (dep_data->refcnt)
dep_data->refcnt--;
if (!dep_data->refcnt) {
ret_dep_data = hash_release(dep->dep_rmap_hash,