Skip to content
Snippets Groups Projects
Commit b12f374b authored by Daniel Salzman's avatar Daniel Salzman Committed by Gerrit Code Review
Browse files

utils: add NULL assignment after free

This eliminates double free if next strdup fails.

refs #2147

Change-Id: Ib6f785b4401144c8fa88feb6c3244de3332e0f5e
parent 7e1a2236
Branches
Tags
No related merge requests found
......@@ -162,6 +162,7 @@ static void get_addr_str(const struct sockaddr_storage *ss,
// Free previous string if any.
free(*dst);
*dst = NULL;
// Write formated information string.
int ret = snprintf(buf, sizeof(buf), "%s#%u(%s)", addr, port,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment