free src conditionally