If you come across this error:
no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
It seems to happen on Ubuntu 12.04 and does not seem to be related to whether ti is a new install or upgrade, there appears to be a kind of solution (this will limit your password synchronization via Samba once done), and it is to remove samba/system password synch as follows:
sudo apt-get remove libpam-smbpass
It worked in my case as only use this for testing on Ubuntu so password synch doe snot matter to me.