pkg

Check-in [38f68bd875]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:pkg check -d: Plug a memory leak
Timelines: family | ancestors | descendants | both | trunk | gsoc2013
Files: files | file ages | folders
SHA1: 38f68bd8758e378a04b3c2f0924db242597968cf
User & Date: bryan@shatow.net 2014-06-11 17:47:25
Context
2014-06-11
17:57
pkg check -d: Fix crash, should not close the db when reopened, it will be closed later Fixes #814 check-in: e34b86c5aa user: bryan@shatow.net tags: trunk, gsoc2013
17:47
pkg check -d: Plug a memory leak check-in: 38f68bd875 user: bryan@shatow.net tags: trunk, gsoc2013
17:40
pkgdb_load_rdeps: Switch to a JOIN syntax check-in: ed7cf1ccb1 user: bryan@shatow.net tags: trunk, gsoc2013
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/check.c.

149
150
151
152
153
154
155

156
157
158
159
160
161
162
	if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK) {
		free(pkgs);
		return (EPKG_ENODB);
	}

	if (pkgdb_obtain_lock(db, PKGDB_LOCK_ADVISORY) != EPKG_OK) {
		pkgdb_close(db);

		warnx("Cannot get an advisory lock on a database, it is locked by another process");
		return (EX_TEMPFAIL);
	}

	if (pkg_jobs_new(&jobs, PKG_JOBS_INSTALL, db) != EPKG_OK) {
		goto cleanup;
	}







>







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
	if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK) {
		free(pkgs);
		return (EPKG_ENODB);
	}

	if (pkgdb_obtain_lock(db, PKGDB_LOCK_ADVISORY) != EPKG_OK) {
		pkgdb_close(db);
		free(pkgs);
		warnx("Cannot get an advisory lock on a database, it is locked by another process");
		return (EX_TEMPFAIL);
	}

	if (pkg_jobs_new(&jobs, PKG_JOBS_INSTALL, db) != EPKG_OK) {
		goto cleanup;
	}