Salut,
j'ai un malloc dans une fonction qui plante.
trans* ajouter(trans *liste, int etat_arr, char lettre) {
trans *pCourant; // définition d'un pointeur courant
trans *nouvelle_transition;
printf("ds ajouter\n");
// Allocation et initialisation de la nouvelle transition
nouvelle_transition = (trans*) malloc(sizeof(trans)); // Ca plante ICI
if (nouvelle_transition == NULL) {
printf("ERROR malloc : Impossible d'allouer de la memoire\n");
exit(11);
}
printf("apres malloc\n")
....
...
}
Je précise que la fonction a marché plusieurs jours sans problème mais que maintenant, quand je lance mon programme,
La fonction marche environ 10 fois et puis au 11 appel le malloc plante. Le programme reste planté environ 10 secondes puis il s'arrête.
Je ne vois pas du tout pourquoi il plante alors qu'il marchait bien avant.