aboutsummaryrefslogtreecommitdiffstats
path: root/g10/photoid.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/photoid.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/g10/photoid.c b/g10/photoid.c
index b311bfa09..1dd6edeca 100644
--- a/g10/photoid.c
+++ b/g10/photoid.c
@@ -49,7 +49,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
char *filename=NULL;
byte *photo=NULL;
byte header[16];
- IOBUF file;
+ iobuf_t file;
header[0]=0x10; /* little side of photo header length */
header[1]=0; /* big side of photo header length */
@@ -60,7 +60,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
header[i]=0;
#define EXTRA_UID_NAME_SPACE 71
- uid=m_alloc_clear(sizeof(*uid)+71);
+ uid=xcalloc (1,sizeof(*uid)+71);
printf(_("\nPick an image to use for your photo ID. "
"The image must be a JPEG file.\n"
@@ -73,7 +73,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
{
printf("\n");
- m_free(filename);
+ xfree (filename);
filename=cpr_get("photoid.jpeg.add",
_("Enter JPEG filename for photo ID: "));
@@ -101,7 +101,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
}
}
- photo=m_alloc(len);
+ photo=xmalloc (len);
iobuf_read(file,photo,len);
iobuf_close(file);
@@ -110,7 +110,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
photo[6]!='J' || photo[7]!='F' || photo[8]!='I' || photo[9]!='F')
{
log_error(_("\"%s\" is not a JPEG file\n"),filename);
- m_free(photo);
+ xfree (photo);
photo=NULL;
continue;
}
@@ -132,7 +132,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
goto scram;
case 0:
free_attributes(uid);
- m_free(photo);
+ xfree (photo);
photo=NULL;
continue;
}
@@ -143,13 +143,13 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
uid->ref=1;
scram:
- m_free(filename);
- m_free(photo);
+ xfree (filename);
+ xfree (photo);
if(error)
{
free_attributes(uid);
- m_free(uid);
+ xfree (uid);
return NULL;
}
@@ -283,7 +283,7 @@ void show_photos(const struct user_attribute *attrs,
if(!command)
goto fail;
- name=m_alloc(16+strlen(EXTSEP_S)+
+ name=xmalloc (16+strlen(EXTSEP_S)+
strlen(image_type_to_string(args.imagetype,0))+1);
/* Make the filename. Notice we are not using the image
@@ -302,7 +302,7 @@ void show_photos(const struct user_attribute *attrs,
if(exec_write(&spawn,NULL,command,name,1,1)!=0)
{
- m_free(name);
+ xfree (name);
goto fail;
}
@@ -311,7 +311,7 @@ void show_photos(const struct user_attribute *attrs,
image_type_to_string(args.imagetype,2));
#endif
- m_free(name);
+ xfree (name);
fwrite(&attrs[i].data[offset],attrs[i].len-offset,1,spawn->tochild);