Author: kkaempf Date: Tue Aug 5 12:09:35 2008 New Revision: 10747 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10747&view=rev Log: fix memory corruption (repo->name needs strdup()) Modified: trunk/sat-solver/bindings/python/tests/repo.py trunk/sat-solver/bindings/repo.i Modified: trunk/sat-solver/bindings/python/tests/repo.py URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/python/tests/repo.py?rev=10747&r1=10746&r2=10747&view=diff ============================================================================== --- trunk/sat-solver/bindings/python/tests/repo.py (original) +++ trunk/sat-solver/bindings/python/tests/repo.py Tue Aug 5 12:09:35 2008 @@ -47,7 +47,7 @@ def test_repo_add(self): pool = satsolver.Pool() assert pool - pool.arch = "i686" + pool.set_arch("i686") repo = pool.add_solv( "os11-biarch.solv" ) repo.set_name("test") assert repo.name() == "test" @@ -61,7 +61,7 @@ # for s in repo: # print s - assert true + assert True if __name__ == '__main__': unittest.main() Modified: trunk/sat-solver/bindings/repo.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/repo.i?rev=10747&r1=10746&r2=10747&view=diff ============================================================================== --- trunk/sat-solver/bindings/repo.i (original) +++ trunk/sat-solver/bindings/repo.i Tue Aug 5 12:09:35 2008 @@ -11,7 +11,9 @@ Repo( Pool *pool, const char *reponame ) { return repo_create( pool, reponame ); } ~Repo() - {} + { } + void remove() + { repo_free( $self, 1 ); } int size() { return $self->nsolvables; } @@ -29,7 +31,10 @@ %rename( "name=" ) set_name( const char *name ); #endif void set_name( const char *name ) - { $self->name = name; } + { if ($self->name) + sat_free((char *)$self->name); + $self->name = strdup(name); + } int priority() { return $self->priority; } #if defined(SWIGRUBY) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org