Patrick McGothigan (22), of Quay Road, appeared at North Antrim Magistrates Court in Coleraine.
He was caught in possession of Class B cannabis resin on April 29 this year and also assaulted two police officers.
A prosecution lawyer told the court that on April 29 this year the drugs were found during a search at Quay Road.
McGothigan assaulted a police officer before saying there was a larger amount of drugs in the kitchen and when being interviewed by police he spat at an officer.
McGothigan’s defence barrister said his client has health issues and had been sectioned at Holywell Hospital from May to July 2010 and then at the Ross Thomson Unit.
The lawyer said McGothigan is keen to engage with whatever help is available for his problems.
District Judge Richard Wilson noted McGothigan had failed to attend appointments and was also in breach of Custody/Probation.
He imposed a five months jail term on the latest offences and activated a suspended four months term to run consecutively making a total of nine months in jail for McGothigan.
A sum of 250 was fixed and McGothigan was bailed pending appeal.