RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall
Root: /v/rpm/cvs Email: rse@rpm5.org
Module: rpm Date: 19-Jul-2007 08:38:07
Branch: HEAD Handle: 2007071907380600
Modified files:
rpm/rpmio rpmlua.c
Log:
lua->printbuf can be NULL and caused a free(NULL) run-time problem
for me. Solve by consistently use the usual _free() usage in rpmlua.c
similar to what is done in the remaining RPM code.
Summary:
Revision Changes Path
2.19 +5 -6 rpm/rpmio/rpmlua.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmlua.c
============================================================================
$ cvs diff -u -r2.18 -r2.19 rpmlua.c
--- rpm/rpmio/rpmlua.c 16 Jul 2007 08:49:04 -0000 2.18
+++ rpm/rpmio/rpmlua.c 19 Jul 2007 06:38:06 -0000 2.19
@@ -114,8 +114,8 @@
/*@=branchstate@*/
if (lua) {
if (lua->L) lua_close(lua->L);
- free(lua->printbuf);
- free(lua);
+ lua->printbuf = _free(lua->printbuf);
+ lua = _free(lua);
}
return NULL;
}
@@ -160,8 +160,7 @@
{
INITSTATE(_lua, lua);
lua->storeprint = flag;
- free(lua->printbuf);
- lua->printbuf = NULL;
+ lua->printbuf = _free(lua->printbuf);
lua->printbufsize = 0;
}
@@ -367,7 +366,7 @@
void *rpmluavFree(rpmluav var)
{
- free(var);
+ var = _free(var);
return NULL;
}
@@ -785,7 +784,7 @@
/*@-compdef -kepttrans -usereleased @*/
args->argt = argt;
rpmhookCallArgs(name, args);
- free(argt);
+ argt = _free(argt);
(void) rpmhookArgsFree(args);
/*@=compdef =kepttrans =usereleased @*/
}
@@ .
Received on Thu Jul 19 08:38:07 2007