~ubuntu-branches/debian/sid/flickcurl/sid

« back to all changes in this revision

Viewing changes to src/ticket.c

  • Committer: Package Import Robot
  • Author(s): Kumar Appaiah
  • Date: 2013-05-20 21:15:09 UTC
  • mfrom: (1.4.1) (15.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130520211509-e701o5dlwa04aqiw
Tags: 1.24-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
    t = (flickcurl_ticket*)calloc(sizeof(flickcurl_ticket), 1);
108
108
    
109
109
    for(attr = node->properties; attr; attr = attr->next) {
 
110
      size_t attr_len = strlen((const char*)attr->children->content);
110
111
      const char *attr_name = (const char*)attr->name;
111
112
      char *attr_value;
112
113
 
113
 
      attr_value = (char*)malloc(strlen((const char*)attr->children->content)+1);
114
 
      strcpy(attr_value, (const char*)attr->children->content);
 
114
      attr_value = (char*)malloc(attr_len + 1);
 
115
      memcpy(attr_value, attr->children->content, attr_len + 1);
115
116
      
116
117
      if(!strcmp(attr_name, "id")) {
117
118
        t->id = atoi(attr_value);
125
126
      } else if(!strcmp(attr_name, "invalid")) {
126
127
        t->invalid = atoi(attr_value);
127
128
        free(attr_value);
128
 
      }
 
129
      } else
 
130
        free(attr_value);
129
131
    }
130
132
 
131
133
#if FLICKCURL_DEBUG > 1