memfixes

Signed-off-by: Mattias Andrée <maandree@operamail.com>
no leaks and violations in memtesting

Signed-off-by: Mattias Andrée <maandree@operamail.com>
fixed basic senario mem

Signed-off-by: Mattias Andrée <maandree@operamail.com>