MCPcopy Create free account
hub / github.com/F-Stack/f-stack / spdcache_entry_alloc

Function spdcache_entry_alloc

freebsd/netipsec/key.c:8200–8217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8198}
8199
8200struct spdcache_entry *
8201spdcache_entry_alloc(const struct secpolicyindex *spidx, struct secpolicy *sp)
8202{
8203 struct spdcache_entry *entry;
8204
8205 entry = malloc(sizeof(struct spdcache_entry),
8206 M_IPSEC_SPDCACHE, M_NOWAIT|M_ZERO);
8207 if (entry == NULL)
8208 return NULL;
8209
8210 if (sp != NULL)
8211 SP_ADDREF(sp);
8212
8213 entry->spidx = *spidx;
8214 entry->sp = sp;
8215
8216 return (entry);
8217}
8218
8219void
8220spdcache_entry_free(struct spdcache_entry *entry)

Callers 1

key_allocspFunction · 0.85

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected