Before returning because of an memory allocation error, free the memory
already allocated to buf. Found using clang's static analyzer - scan-build Submitted by: Thomas Rix <trix@juniper.net> Reviewed by: stevek Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9852
This commit is contained in:
parent
7c91b65f54
commit
ba01ab64cc
@ -145,6 +145,7 @@ iface_Create(const char *name)
|
||||
iface = (struct iface *)malloc(sizeof *iface);
|
||||
if (iface == NULL) {
|
||||
fprintf(stderr, "iface_Create: malloc: %s\n", strerror(errno));
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
iface->name = strdup(name);
|
||||
|
Loading…
Reference in New Issue
Block a user