It depends, if your necromancer is undead they become free.
Libris Mortis, page 13, about controlling undead:
Once undead have created their spawn, they may command these “children” as they see fit. Their power over the spawn they have created remains in effect until their death, at which time all their spawn become free.
Reading this you might think this rule only applies to undead created by other undead through some special ability, but, what is "spawn"?
Libris Mortis, page 13, about undead spawn:
Many undead have the ability to create spawn (see Undead Propagation, above)
Following that rule's trail...
Libris Mortis, page 11, about undead propagation:
Creating Undead Spawn: [...] The unliving make use of several different methods to create new undead creatures. These methods, and the creatures that employ them, are summarized in Table 1–2.
Libris Mortis, page 11, from table 1-2:
║ Method ║ Creatures That Use It ║
║ ... ║ ... ║
║ Magical creation ║ Lich, mummy, skeleton, zombie ║
║ ... ║ ... ║
This means "magical creation" is a valid method of undead propagation, ergo, when you create zombies or skeletons by casting Animate Dead, you're creating undead spawn, therefore, the first quoted rule about them becoming free when you die applies, at least if you (the creator) are undead (being a necropolitan, for example, is not uncommon for a necromancer).
If you're not undead the rules are silent, but it wouldn't be unreasonable for a DM to rule the same.
By the way, even if they become uncontrolled after they die, skeletons and zombies are mindless, that means they only do as ordered, if orders are absent they will do nothing except maybe defend themselves, they won't attack the party unless the party attacks first.
Rules Compendium, page 105, about intelligence as a nonability:
A creature that has no Intelligence score is mindless, an automaton
operating on simple instincts or programmed instructions.
Libris Mortis, page 12, about undead sentience:
The ability to think is a quality the vast bulk of undead do not
possess. Mindless undead merely respond to preset commands or stimuli,
driven by nothing other than the energy that animates them. These
undead have no outlook; they are robbed of thought. They are nearly
mechanical in their actions, and often those actions are as easy to
anticipate as the revolution of a water wheel.
Monster manual, page 225, about skeletons:
A skeleton does only what it is ordered to do.
Monster Manual, page 265, about zombies:
These mindless automatons shamble about, doing their creator’s bidding without fear or hesitation.