Most fruit fly cultures (and medium) come with mold inhibitors, so that shouldn't be an issue.