A 61-year-old man caught with €150 worth of heroin in Blackrock village was given a suspended three-month sentence.
Tony Everson of Tír na nÓg, Blackrock, Cork, pleaded guilty at Cork District Court to having the drugs for his own use.
Garda Paul Lynch stopped and searched the defendant on July 7 2020.
Two wraps of heroin with a total value of €150 were found.
Frank Buttimer, defence solicitor, said the defendant did not have an addiction difficulty.