The word suggests sadistic enjoyment though the dictionary simply defines it thus:
enjoyment obtained from the troubles of others
But it seems that the badness of enjoying troubles from others is dependent on how it is obtained, i.e., the reasons for that enjoyment.
Imagine that someone is depressed because she thinks her life worthless and tragic. She thinks herself especially wronged or unlucky. Suppose now that she meets someone she thinks either similar in being dealt a "bad hand" in life or worse. Now she realizes that there are others like her or in worse circumstances and she feels some relief and maybe even joy at this knowledge. She no longer pities herself as much and can move on with her life a little easier knowing that life ain't all that bad for her. This joy in the camaraderie of misery comes about in at least three possible ways that are not sadistic: through knowing that someone out there may be able to empathize with her or knowing that "things could be worse" or that she has positive things to be thankful of.
But maybe reasons matter to the definition of schadenfreude? Therefore, having these non-sadistic reasons disqualifies it from being "real" schadenfreude? I don't know, that seems rather implausible to me but maybe I just don't really know how that word is commonly used.