Reasons for not putting it back in the ocean, if you are near and can do that would be if it were with other SW
creatures and could transfer disease back to the ocean friends.
Since you do not have any other SW
creatures then it would be sensible it wouldn't have caught anything from your tank / cup/ container.
Put it back where it came from.
Or a saltwater store might take it, or if there aren't any other options, maybe a SW
keeper would want it.