Changeset 3509 in MondoRescue for branches/3.2/mondo/src/lib/mr_mem.c
- Timestamp:
- Feb 13, 2016, 2:57:55 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/lib/mr_mem.c
r3294 r3509 36 36 *allocated = NULL; 37 37 } else { 38 mr_msg_int(8,line,file," Attempt to free NULL pointer");38 mr_msg_int(8,line,file,"mr_asprintf","Attempt to free NULL pointer"); 39 39 } 40 40 } … … 47 47 ret = malloc(size); 48 48 if (ret == NULL) { 49 mr_msg_int(1,line,file," Unable to alloc memory in mr_malloc\nExiting...");49 mr_msg_int(1,line,file,"mr_asprintf","Unable to alloc memory in mr_malloc\nExiting..."); 50 50 mr_exit(-1,"Unable to alloc memory in mr_malloc"); 51 51 } … … 62 62 res = vasprintf(strp, fmt, args); 63 63 if (res == -1) { 64 mr_msg_int(1,line,file," Unable to alloc memory in mr_asprintf\nExiting...");64 mr_msg_int(1,line,file,"mr_asprintf","Unable to alloc memory in mr_asprintf\nExiting..."); 65 65 mr_exit(-1,"Unable to alloc memory in mr_asprintf"); 66 66 } … … 76 76 if (*lineptr != NULL) { 77 77 /* free a variable which should be already free */ 78 mr_msg_int(1,line,file,"mr_getline_ found a non freed variable here");78 mr_msg_int(1,line,file,"mr_getline_int","mr_getline_ found a non freed variable here"); 79 79 mr_free_int((void **)lineptr,line,file); 80 80 } 81 81 ret = getline(lineptr,&n,fd); 82 82 if ((ret == -1) && (! feof(fd))) { 83 mr_msg_int(1,line,file," Unable to alloc memory in mr_getline\nExiting...");83 mr_msg_int(1,line,file,"mr_getline_int","Unable to alloc memory in mr_getline\nExiting..."); 84 84 mr_exit(-1,"Unable to alloc memory in mr_getline"); 85 85 } … … 109 109 110 110 if (name == NULL) { 111 mr_msg_int(1,line,file," Unable to setenv a NULL variable\nExiting...");111 mr_msg_int(1,line,file,"mr_setenv_int","Unable to setenv a NULL variable\nExiting..."); 112 112 mr_exit(-1, "Unable to setenv a NULL variable"); 113 113 } 114 114 if (value == NULL) { 115 mr_msg_int(1,line,file," Unable to affect NULL to %s\nExiting...", name);115 mr_msg_int(1,line,file,"mr_setenv_int","Unable to affect NULL to %s\nExiting...", name); 116 116 mr_exit(-1, "Unable to affect a NULL variable"); 117 117 } 118 118 if (setenv(name, value, 1) != 0) { 119 mr_msg_int(1,line,file," Unable to put %s in environment", name);119 mr_msg_int(1,line,file,"mr_setenv_int","Unable to put %s in environment", name); 120 120 mr_exit(-1,"Unable to put in environment"); 121 121 } … … 136 136 } 137 137 if (in == NULL) { 138 mr_msg_int(1,line,file," Unable to add to NULL pointer\nExiting...");138 mr_msg_int(1,line,file,"mr_strcat_int","Unable to add to NULL pointer\nExiting..."); 139 139 mr_exit(-1, "Unable to add to a NULL pointer"); 140 140 } … … 143 143 res = vasprintf(in, fmt, args); 144 144 if (res == -1) { 145 mr_msg_int(1,line,file," Unable to alloc memory in mr_strcat\nExiting...");145 mr_msg_int(1,line,file,"mr_strcat_int","Unable to alloc memory in mr_strcat\nExiting..."); 146 146 mr_exit(-1,"Unable to alloc memory in mr_strcat"); 147 147 } … … 151 151 res = vasprintf(in, fmt2, args); 152 152 if (res == -1) { 153 mr_msg_int(1,line,file," Unable to alloc memory in mr_strcat\nExiting...");153 mr_msg_int(1,line,file,"mr_strcat_int","Unable to alloc memory in mr_strcat\nExiting..."); 154 154 mr_exit(-1,"Unable to alloc memory in mr_strcat"); 155 155 }
Note:
See TracChangeset
for help on using the changeset viewer.