[redland] Redland giving seg fault in a loop.

abhinkar at yahoo.com abhinkar at yahoo.com
Mon Oct 29 01:37:50 GMT 2001


Hi All:

I have a small routine which is giving me a seg fault. It gives me a
seg fault as soon as I go into the loop the second time at line 8. Am
I doing everything correctly? I could get rid of this problem by 
calling the librdf_new_world() call outside the loop. But if I would
like to do it "this" way why is that I get a seg. fault at the second
time. Am I missing some initializations..?

1   void main() {
2       int  i;
3	librdf_world    *rlworld;
4	librdf_uri	*rluri;
5       for (i =0;i<100;i++) { 
6           rlworld = librdf_new_world();
7	    if (rlworld!=NULL) {
8               librdf_world_open(rlworld);
9           } else {
10               return 1;
11	    }
12	    rluri = librdf_new_uri(rlworld,"file:///some/uri");
13          librdf_free_uri(rlworld);
14	    librdf_free_world(rlworld);
15          if (rlworld != NULL) {
16	       rlworld = 0;
17	    }
18      }
19  }

Cheers,
Sameer Abhinkar
        librdf_free_world(rlworld);







More information about the redland-dev mailing list