From 03b36d4aa2a8619cb7d2bcd5bc67923fa14293b8 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Mon, 16 Apr 2012 23:24:10 +0400 Subject: We need only the number of matches --- libaugeas.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libaugeas.cc b/libaugeas.cc index 8797b85..9601d34 100644 --- a/libaugeas.cc +++ b/libaugeas.cc @@ -435,7 +435,6 @@ struct LoadFileUV { void blockingLoadFile(uv_work_t * req) { - char **matches; const char *val; int mres; LoadFileUV *lfuv = (LoadFileUV *) req->data; @@ -470,7 +469,7 @@ void blockingLoadFile(uv_work_t * req) } errPath = "/augeas/files" + lfuv->incl + "/error"; - mres = aug_match(lfuv->m_aug, errPath.c_str(), &matches); + mres = aug_match(lfuv->m_aug, errPath.c_str(), NULL); if (mres) { if (aug_get(lfuv->m_aug, std::string(errPath + "/line").c_str(), &val)) { @@ -481,7 +480,6 @@ void blockingLoadFile(uv_work_t * req) lfuv->msg = lfuv->msg + ": " + val; } lfuv->ret = -1; - free(matches); return; } @@ -600,7 +598,6 @@ struct SaveFileUV { void blockingSaveFile(uv_work_t * req) { - char **matches; const char *val; int mres; SaveFileUV *lfuv = (SaveFileUV *) req->data; @@ -611,7 +608,7 @@ void blockingSaveFile(uv_work_t * req) std::string lensVal = lfuv->lens + ".lns"; std::string filesPath = "/files" + lfuv->incl; - mres = aug_match(lfuv->m_aug, inclPath.c_str(), &matches); + mres = aug_match(lfuv->m_aug, inclPath.c_str(), NULL); if (!mres) { lfuv->ret = aug_set(lfuv->m_aug, lensPath.c_str(), lensVal.c_str()); @@ -639,7 +636,7 @@ void blockingSaveFile(uv_work_t * req) } errPath = "/augeas" + filesPath + "/error"; - mres = aug_match(lfuv->m_aug, errPath.c_str(), &matches); + mres = aug_match(lfuv->m_aug, errPath.c_str(), NULL); if (mres) { if (aug_get(lfuv->m_aug, std::string(errPath + "/line").c_str(), &val)) { @@ -650,7 +647,6 @@ void blockingSaveFile(uv_work_t * req) lfuv->msg = lfuv->msg + ": " + val; } lfuv->ret = -1; - free(matches); return; } } -- cgit v1.2.3