Fix leak when downgrading a package.
[oweals/opkg-lede.git] / libopkg / opkg_install.c
index 6b69da998908dd68cc15a29412a1820938089f3b..a76322d12358aa45ca8bf89374e0b37ec5c0459d 100644 (file)
@@ -203,6 +203,8 @@ opkg_error_t opkg_install_by_name(opkg_conf_t *conf, const char *pkg_name)
          } else if (cmp < 0) {
               new->dest = old->dest;
               old->state_want = SW_DEINSTALL;    /* Here probably the problem for bug 1277 */
+              free(old_version);
+              free(new_version);
          }
      }