summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/miiphyutil.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 0811e09..7e41957 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -114,6 +114,8 @@ void miiphy_register(const char *name,
if (new_dev == NULL || ldev == NULL) {
printf("miiphy_register: cannot allocate memory for '%s'\n",
name);
+ free(ldev);
+ mdio_free(new_dev);
return;
}